friends/database/3ds/update_user_comment.go
Daniel López Guimaraes 2f80336681
Rename friends-secure to friends and remove Mongo
Replace MongoDB usage with GRPC calls to the account server. Also
include documentation on the README and a Makefile.
2023-08-13 01:05:08 +01:00

26 lines
531 B
Go

package database_3ds
import (
"github.com/PretendoNetwork/friends/database"
"github.com/PretendoNetwork/nex-go"
)
// UpdateUserComment updates a user's comment
func UpdateUserComment(pid uint32, message string) error {
changed := nex.NewDateTime(0).Now()
_, err := database.Postgres.Exec(`
INSERT INTO "3ds".user_data (pid, comment, comment_changed)
VALUES ($1, $2, $3)
ON CONFLICT (pid)
DO UPDATE SET
comment = $2,
comment_changed = $3`, pid, message, changed)
if err != nil {
return err
}
return nil
}