tidying some things up

session message handling is pretty annoying; should look into a better method of doing this
This commit is contained in:
ari melody 2025-01-23 09:39:40 +00:00
parent 45f33b8b46
commit e457e979ff
Signed by: ari
GPG key ID: CF99829C92678188
8 changed files with 161 additions and 82 deletions

View file

@ -108,7 +108,7 @@ func CreateAccount(db *sqlx.DB, account *model.Account) error {
func UpdateAccount(db *sqlx.DB, account *model.Account) error {
_, err := db.Exec(
"UPDATE account " +
"SET username=$2, password=$3, email=$4, avatar_url=$5) " +
"SET username=$2,password=$3,email=$4,avatar_url=$5 " +
"WHERE id=$1",
account.ID,
account.Username,
@ -120,7 +120,7 @@ func UpdateAccount(db *sqlx.DB, account *model.Account) error {
return err
}
func DeleteAccount(db *sqlx.DB, username string) error {
_, err := db.Exec("DELETE FROM account WHERE username=$1", username)
func DeleteAccount(db *sqlx.DB, accountID string) error {
_, err := db.Exec("DELETE FROM account WHERE id=$1", accountID)
return err
}