Skip to content

Commit

Permalink
✨ sync in storage
Browse files Browse the repository at this point in the history
  • Loading branch information
egorgasay committed Mar 30, 2024
1 parent b975800 commit ac67f5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/storage/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func (s *Storage) NewUser(user models.User) (r gost.Result[int]) {
user.ID = id
s.users.Put(id, user)

s.users.changeID++

return r.Ok(id)
}

Expand Down Expand Up @@ -73,6 +75,8 @@ func (s *Storage) DeleteUser(id int) (r gost.Result[bool]) {

s.users.Delete(id)

s.users.changeID++

return r.Ok(true)
}

Expand All @@ -86,6 +90,8 @@ func (s *Storage) SaveUser(user models.User) (r gost.ResultN) {

s.users.Put(user.ID, user)

s.users.changeID++

return r.Ok()
}

Expand Down

0 comments on commit ac67f5e

Please sign in to comment.