wip: session auth middleware

This commit is contained in:
2025-06-05 06:26:11 +01:00
parent af8323cdb0
commit 627633ea29
10 changed files with 96 additions and 29 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ func (db *DB) GetClients() ([]types.Client, error) {
return clients, nil
}
func (db *DB) GetClient(id int, client *types.Client) error {
func (db *DB) GetClient(id uint32, client *types.Client) error {
result := db.instance.Where("id = ?", id).First(client, id)
if result.Error != nil {
@@ -45,7 +45,7 @@ func (db *DB) GetClient(id int, client *types.Client) error {
return nil
}
func (db *DB) UpdateClient(id int, body types.UpdateClientRequestBody, client *types.Client) error {
func (db *DB) UpdateClient(id uint32, body types.UpdateClientRequestBody, client *types.Client) error {
result := db.instance.Where("id = ?", id).First(client, id)
if result.Error != nil {
@@ -69,7 +69,7 @@ func (db *DB) UpdateClient(id int, body types.UpdateClientRequestBody, client *t
return nil
}
func (db *DB) DeleteClient(id int) error {
func (db *DB) DeleteClient(id uint32) error {
result := db.instance.Delete(&types.Client{}, id)
if result.Error != nil {