tidying some things up
session message handling is pretty annoying; should look into a better method of doing this
This commit is contained in:
parent
45f33b8b46
commit
e457e979ff
8 changed files with 161 additions and 82 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue