mirror of
https://github.com/kaaninchen/Laterna.git
synced 2026-09-17 19:12:48 +00:00
refactor: clarify response on createController
This commit is contained in:
@@ -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"`
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user