feat: UpdateUser
This commit is contained in:
parent
c539ce303a
commit
79e7443176
1 changed files with 10 additions and 0 deletions
|
@ -30,3 +30,13 @@ func DeleteUser(login string) {
|
||||||
ctx := storage.GetContext()
|
ctx := storage.GetContext()
|
||||||
storage.Delete(ctx, login)
|
storage.Delete(ctx, login)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UpdateUser(login string, password interop.Hash256) {
|
||||||
|
ctx := storage.GetContext()
|
||||||
|
storedValue := storage.Get(ctx, login).(interop.Hash256)
|
||||||
|
if storedValue == nil {
|
||||||
|
panic("This user does not exist")
|
||||||
|
} else {
|
||||||
|
storage.Put(ctx, login, password)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue