feat: user update last login

This commit is contained in:
2025-06-04 20:07:48 +02:00
parent 7b8fe6baf2
commit 118877f727
2 changed files with 16 additions and 0 deletions

View File

@ -118,6 +118,17 @@ func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (uuid.UU
return id, err
}
const updateLastLogin = `-- name: UpdateLastLogin :exec
UPDATE users
SET last_login = NOW()
WHERE id = $1
`
func (q *Queries) UpdateLastLogin(ctx context.Context, id uuid.UUID) error {
_, err := q.db.Exec(ctx, updateLastLogin, id)
return err
}
const updateProfilePicture = `-- name: UpdateProfilePicture :exec
UPDATE users
SET profile_picture = $1

View File

@ -19,3 +19,8 @@ SELECT * FROM users WHERE id = $1 LIMIT 1;
UPDATE users
SET profile_picture = $1
WHERE id = $2;
-- name: UpdateLastLogin :exec
UPDATE users
SET last_login = NOW()
WHERE id = $1;