refactor: clarify response on createController

This commit is contained in:
Kaaninchen
2026-08-03 19:17:59 +02:00
parent 0ea3d4f4ac
commit 6a3a0b2156
2 changed files with 1 additions and 5 deletions
-4
View File
@@ -43,10 +43,6 @@ type DeleteData struct {
Deleted int `json:"deleted"` Deleted int `json:"deleted"`
} }
type CreateData struct {
Created int `json:"created"`
}
type ToggleController struct { type ToggleController struct {
ID int `json:"id"` ID int `json:"id"`
Active bool `json:"active"` Active bool `json:"active"`
+1 -1
View File
@@ -23,7 +23,7 @@ func createController(w http.ResponseWriter, r *http.Request) {
if err != nil { if err != nil {
utils.ErrorResponse(w, http.StatusInternalServerError, "An error occured. Check the server logs for more information") utils.ErrorResponse(w, http.StatusInternalServerError, "An error occured. Check the server logs for more information")
} }
utils.SuccessResponse(w, http.StatusOK, models.CreateData{Created: int(ID)}) utils.SuccessResponse(w, http.StatusOK, models.ControllerRequests{ID: int(ID)})
} }
func deleteController(w http.ResponseWriter, r *http.Request) { func deleteController(w http.ResponseWriter, r *http.Request) {