working commit
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
|
||||
"mstore/pkg/descr"
|
||||
"mstore/pkg/uuid"
|
||||
)
|
||||
|
||||
func (db *Database) InsertAccount(ctx context.Context, account *descr.Account) error {
|
||||
@@ -20,7 +19,7 @@ func (db *Database) InsertAccount(ctx context.Context, account *descr.Account) e
|
||||
return err
|
||||
}
|
||||
|
||||
func (db *Database) UpdateAccountByID(ctx context.Context, accountID uuid.UUID, account *descr.Account) error {
|
||||
func (db *Database) UpdateAccountByID(ctx context.Context, accountID uint64, 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)
|
||||
@@ -52,7 +51,7 @@ func (db *Database) ListAccounts(ctx context.Context) ([]descr.Account, error) {
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (db *Database) GetAccountByID(ctx context.Context, accountID uuid.UUID) (bool, *descr.Account, error) {
|
||||
func (db *Database) GetAccountByID(ctx context.Context, accountID uint64) (bool, *descr.Account, error) {
|
||||
var err error
|
||||
var res *descr.Account
|
||||
var exists bool = false
|
||||
@@ -91,7 +90,7 @@ func (db *Database) GetAccountByUsername(ctx context.Context, username string) (
|
||||
return exists, res, err
|
||||
}
|
||||
|
||||
func (db *Database) DeleteAccountByID(ctx context.Context, accountID uuid.UUID) error {
|
||||
func (db *Database) DeleteAccountByID(ctx context.Context, accountID uint64) error {
|
||||
var err error
|
||||
|
||||
request := `DELETE FROM accounts WHERE id = $1`
|
||||
|
||||
Reference in New Issue
Block a user