storj/satellite/console/consoleweb
Cameron 240b70b828 satellite/console: use new type UpdateUserRequest as arg to db users.Update
The users.Update method in the satellitedb package takes a console.User
as an argument. It reads some of the fields on this struct and assigns
the value to dbx.User_Update_Fields. However, you cannot optionally
update only some of the fields. They all will always be updated. This means
that if you only want to update FullName, you still need to read the
user info from the DB to avoid updating the rest of the fields to zero.
This is not good because concurrent updates can overwrite each other.

This change introduces a new struct type, UpdateUserRequest, which
contains pointers for all the fields that are updated by satellite db
users.Update. Now the update method will check if a field is nil before
assigning the value to be updated in the db, so you only need to set the
field you want updated. For nullable columns, the respective field is a
double pointer. This allows us to update a column to NULL if the outer
pointer is not nil, but the inner pointer is.

Change-Id: I27f842d283c2711e24d51dcab622e57eeb9157f1
2022-06-14 09:28:03 -04:00
..
consoleapi satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
consoleql satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
consolewebauth satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
endpoints_test.go satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
server_test.go satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
server.go satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
utils.go all: fix dots 2020-07-16 14:58:28 +00:00