fix(api): fix patching fields

This commit is contained in:
Sam 2022-06-17 16:03:47 +02:00
parent 512e977d0d
commit 59a1a3fb9b
1 changed files with 2 additions and 1 deletions

View File

@ -104,9 +104,10 @@ func (db *DB) SetUserFields(ctx context.Context, tx pgx.Tx, userID xid.ID, field
_, err = tx.CopyFrom(ctx,
pgx.Identifier{"user_fields"},
[]string{"name", "favourite", "okay", "jokingly", "friends_only", "avoid"},
[]string{"user_id", "name", "favourite", "okay", "jokingly", "friends_only", "avoid"},
pgx.CopyFromSlice(len(fields), func(i int) ([]any, error) {
return []any{
userID,
fields[i].Name,
fields[i].Favourite,
fields[i].Okay,