Add various deleted flags to entities | Add active to subscriptions | Add DeleteUser && DeleteChannel endpoints
Build Docker and Deploy / Deploy to Server (push) Blocked by required conditions
Build Docker and Deploy / Build Docker Container (push) Successful in 53s
Build Docker and Deploy / Run Unit-Tests (push) Has been cancelled

This commit is contained in:
2025-04-13 16:12:15 +02:00
parent aac34ef738
commit 67882713f9
47 changed files with 2453 additions and 243 deletions
+15
View File
@@ -21,6 +21,7 @@ func (db *Database) CreateClient(ctx db.TxContext, userid models.UserID, ctype m
AgentModel: agentModel,
AgentVersion: agentVersion,
Name: name,
Deleted: false,
}
_, err = sq.InsertSingle(ctx, tx, "clients", entity)
@@ -159,3 +160,17 @@ func (db *Database) UpdateClientDescriptionName(ctx db.TxContext, clientid model
return nil
}
func (db *Database) DeleteClientsOfUser(ctx db.TxContext, userid models.UserID) error {
tx, err := ctx.GetOrCreateTransaction(db)
if err != nil {
return err
}
_, err = tx.Exec(ctx, "UPDATE clients SET deleted=1 WHERE user_id = :uid AND deleted=0", sq.PP{"uid": userid})
if err != nil {
return err
}
return nil
}