mirror of
https://github.com/PretendoNetwork/friends.git
synced 2025-04-02 11:01:46 -04:00
25 lines
693 B
Go
25 lines
693 B
Go
package database_3ds
|
|
|
|
import (
|
|
"github.com/PretendoNetwork/friends/database"
|
|
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/v2/friends-3ds/types"
|
|
)
|
|
|
|
// UpdateUserProfile updates a user's profile
|
|
func UpdateUserProfile(pid uint32, profileData friends_3ds_types.MyProfile) error {
|
|
_, err := database.Manager.Exec(`
|
|
INSERT INTO "3ds".user_data (pid, region, area, language, country)
|
|
VALUES ($1, $2, $3, $4, $5)
|
|
ON CONFLICT (pid)
|
|
DO UPDATE SET
|
|
region = $2,
|
|
area = $3,
|
|
language = $4,
|
|
country = $5`, pid, uint8(profileData.Region), uint8(profileData.Area), uint8(profileData.Language), uint8(profileData.Country))
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|