mirror of
https://github.com/PretendoNetwork/friends.git
synced 2025-04-02 11:01:46 -04:00
22 lines
519 B
Go
22 lines
519 B
Go
package database_3ds
|
|
|
|
import (
|
|
"github.com/PretendoNetwork/friends/database"
|
|
)
|
|
|
|
// UpdateUserPreferences updates a user's preferences
|
|
func UpdateUserPreferences(pid uint32, show_online bool, show_current_game bool) error {
|
|
_, err := database.Manager.Exec(`
|
|
INSERT INTO "3ds".user_data (pid, show_online, show_current_game)
|
|
VALUES ($1, $2, $3)
|
|
ON CONFLICT (pid)
|
|
DO UPDATE SET
|
|
show_online = $2,
|
|
show_current_game = $3`, pid, show_online, show_current_game)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|