storj/satellite/console
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
..
consoleauth satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
consolewasm web/satellite: add consent screen for oauth 2022-04-27 14:33:07 +00:00
consoleweb satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
emailreminders satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
restkeys satellite: Rename "acct mgmt api" to "rest api" 2022-04-25 18:51:46 +00:00
wasm web/satellite: add consent screen for oauth 2022-04-27 14:33:07 +00:00
apikeys_test.go satellite/satellitedb: select user_agent in apikeys method GetPagedByProjectID 2022-01-03 11:58:26 -05:00
apikeys.go apigen: create api key endpoint 2022-05-26 16:00:23 +00:00
attribution_test.go satellite/buckets: add new buckets service 2021-11-16 12:36:17 +02:00
billinghistoryitem.go satellite/payments: available coupon value feature 2020-06-02 10:00:45 +00:00
buckets.go satellite/metabase: move package one level higher 2021-04-21 15:54:22 +03:00
captcha_test.go satellite/console,web/satellite: Implement hCaptcha 2022-05-13 14:57:45 +00:00
captcha.go satellite/console,web/satellite: Implement hCaptcha 2022-05-13 14:57:45 +00:00
database.go satellite/console: implement WebappSessions db 2022-05-16 15:06:04 +00:00
mfa.go satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
projectmembers_test.go all: remove old uuid 2020-04-02 19:30:36 +03:00
projectmembers.go all: add missing dots 2020-08-11 17:50:01 +03:00
projects_test.go satellite/{admin,console}: Move tests 2021-10-01 12:25:37 +00:00
projects.go rest-api: endpoint reworkings 2022-04-28 18:17:54 +00:00
projectusagelimits.go satellite/{console,satellitedb}: add project segment limit to user 2021-12-16 08:46:01 +00:00
registrationtoken.go all: golangci-lint v1.33.0 fixes (#3985) 2020-12-05 17:01:42 +01:00
request.go satellite/console: integrate sessions into satellite UI 2022-06-13 08:02:02 +00:00
resetpasswordtoken_test.go all: fix linter complaints 2020-10-13 15:59:01 +03:00
resetpasswordtoken.go all: golangci-lint v1.33.0 fixes (#3985) 2020-12-05 17:01:42 +01:00
service_test.go satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
service.go satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
sortdirection.go all: fix comments 2020-07-16 19:13:14 +03:00
users_test.go satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
users.go satellite/console: use new type UpdateUserRequest as arg to db users.Update 2022-06-14 09:28:03 -04:00
validation.go satellite/console: Don't lose ErrValiation error class 2022-02-28 11:00:56 +00:00