From 6b80eaa6918ac760369fe99b53ede90e1cf7979d Mon Sep 17 00:00:00 2001 From: mkwcat Date: Sat, 16 Dec 2023 11:52:35 -0500 Subject: [PATCH] Database: Fix missing argument in InsertUserWithProfileID --- database/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/user.go b/database/user.go index 2c6933e..a63f9f0 100644 --- a/database/user.go +++ b/database/user.go @@ -9,7 +9,7 @@ import ( const ( InsertUser = `INSERT INTO users (user_id, gsbrcd, password, ng_device_id, email, unique_nick) VALUES ($1, $2, $3, $4, $5, $6) RETURNING profile_id` - InsertUserWithProfileID = `INSERT INTO users (user_id, gsbrcd, password, ng_device_id, email, unique_nick) VALUES ($1, $2, $3, $4, $5, $6)` + InsertUserWithProfileID = `INSERT INTO users (profile_id, user_id, gsbrcd, password, ng_device_id, email, unique_nick) VALUES ($1, $2, $3, $4, $5, $6, $7)` UpdateUserTable = `UPDATE users SET firstname = CASE WHEN $3 THEN $2 ELSE firstname END, lastname = CASE WHEN $5 THEN $4 ELSE lastname END WHERE profile_id = $1 RETURNING user_id, gsbrcd, email, unique_nick, firstname, lastname` UpdateUserProfileID = `UPDATE users SET profile_id = $3 WHERE user_id = $1 AND gsbrcd = $2` UpdateUserNGDeviceID = `UPDATE users SET ng_device_id = $2 WHERE profile_id = $1` @@ -58,7 +58,7 @@ func (user *User) CreateUser(pool *pgxpool.Pool, ctx context.Context) error { return ErrProfileIDInUse } - _, err = pool.Exec(ctx, InsertUserWithProfileID, user.UserId, user.GsbrCode, "", user.NgDeviceId, user.Email, user.UniqueNick, user.ProfileId) + _, err = pool.Exec(ctx, InsertUserWithProfileID, user.ProfileId, user.UserId, user.GsbrCode, "", user.NgDeviceId, user.Email, user.UniqueNick) return err }