feat: user update last login
This commit is contained in:
@ -118,6 +118,17 @@ func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (uuid.UU
|
|||||||
return id, err
|
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
|
const updateProfilePicture = `-- name: UpdateProfilePicture :exec
|
||||||
UPDATE users
|
UPDATE users
|
||||||
SET profile_picture = $1
|
SET profile_picture = $1
|
||||||
|
@ -19,3 +19,8 @@ SELECT * FROM users WHERE id = $1 LIMIT 1;
|
|||||||
UPDATE users
|
UPDATE users
|
||||||
SET profile_picture = $1
|
SET profile_picture = $1
|
||||||
WHERE id = $2;
|
WHERE id = $2;
|
||||||
|
|
||||||
|
-- name: UpdateLastLogin :exec
|
||||||
|
UPDATE users
|
||||||
|
SET last_login = NOW()
|
||||||
|
WHERE id = $1;
|
||||||
|
Reference in New Issue
Block a user