working commit

This commit is contained in:
2026-02-21 12:31:39 +02:00
parent 3220e2d78f
commit cd37a4508c
37 changed files with 354 additions and 319 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ func (db *Database) InsertAccount(ctx context.Context, account *descr.Account) e
return err
}
func (db *Database) UpdateAccountByID(ctx context.Context, accountID uint64, account *descr.Account) error {
func (db *Database) UpdateAccountByID(ctx context.Context, accountID string, account *descr.Account) error {
var err error
request := `UPDATE accounts SET username = $1, passhash = $2, disabled = $3, updated_at = $4, updated_by = $5 WHERE id = $6`
_, err = db.db.Exec(request, account.Username, account.Passhash, account.Disabled, account.UpdatedAt, account.UpdatedBy, accountID)
@@ -51,7 +51,7 @@ func (db *Database) ListAccounts(ctx context.Context) ([]descr.Account, error) {
return res, err
}
func (db *Database) GetAccountByID(ctx context.Context, accountID uint64) (bool, *descr.Account, error) {
func (db *Database) GetAccountByID(ctx context.Context, accountID string) (bool, *descr.Account, error) {
var err error
var res *descr.Account
var exists bool = false
@@ -90,7 +90,7 @@ func (db *Database) GetAccountByUsername(ctx context.Context, username string) (
return exists, res, err
}
func (db *Database) DeleteAccountByID(ctx context.Context, accountID uint64) error {
func (db *Database) DeleteAccountByID(ctx context.Context, accountID string) error {
var err error
request := `DELETE FROM accounts WHERE id = $1`