From ac67f5ec773b8c9df4ad71f60cdc5ff406768daa Mon Sep 17 00:00:00 2001 From: Egor Date: Sat, 30 Mar 2024 20:45:33 +0300 Subject: [PATCH] :sparkles: sync in storage --- internal/storage/users.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/storage/users.go b/internal/storage/users.go index 4c6aa0b..7b230c2 100644 --- a/internal/storage/users.go +++ b/internal/storage/users.go @@ -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) } @@ -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) } @@ -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() }