feat(api): delete template endpoint

This commit is contained in:
Leons Aleksandrovs
2025-07-13 14:26:09 +03:00
parent fa095def44
commit e969d56ab6
4 changed files with 45 additions and 3 deletions
+10
View File
@@ -82,3 +82,13 @@ func Update(id int, name string, template string) error {
return err
}
func Delete(id int) error {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
query := `DELETE FROM templates WHERE id = $1`
_, err := db.Pool.Exec(ctx, query, id)
return err
}