mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-04-24 23:07:13 -05:00
26 lines
690 B
Go
26 lines
690 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, profileData.Region.Value, profileData.Area.Value, profileData.Language.Value, profileData.Country.Value)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|