feat(svg): added svg template delete endpoint
build / Go-Build (push) Successful in 1m23s
build / Go-Build (pull_request) Successful in 1m23s

This commit is contained in:
2026-05-15 17:24:45 +02:00
parent 372bf4f97f
commit e39821a3e2
8 changed files with 82 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
package routes
import (
"net/http"
"tomatentum.net/svg-templater/pkg/svg/actions"
)
func DeleteSvg(writer http.ResponseWriter, reader *http.Request) {
id := reader.PathValue("id")
if id == "" {
http.Error(writer, "No ID provided", http.StatusBadRequest)
return
}
success, err := actions.Delete(id)
if err != nil {
http.Error(writer, err.Error(), http.StatusInternalServerError)
return
}
if !success {
http.Error(writer, "No template to delete.", http.StatusBadRequest)
return
}
}