This commit is contained in:
2026-05-23 17:17:56 -07:00
commit 448f2e33ef
135 changed files with 11817 additions and 0 deletions
@@ -0,0 +1,34 @@
package routes
import (
"gifuu/tools"
"net/http"
)
func DELETE_Moderation_Art_ID(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
paramID := tools.ParseSnowflake(r.PathValue("id"))
if paramID == 0 {
tools.SendClientError(w, r, tools.ERROR_BODY_INVALID_FIELD)
return
}
// Delete Art
tag, err := tools.Database.Exec(ctx,
`DELETE FROM gifuu.upload WHERE id = $1`,
paramID,
)
if err != nil {
tools.SendServerError(w, r, err)
return
}
if tag.RowsAffected() == 0 {
tools.SendClientError(w, r, tools.ERROR_GENERIC_UNAUTHORIZED)
return
}
go RemoveFilesForArt(paramID)
w.WriteHeader(http.StatusNoContent)
}