Remove unnecessary receiver from campsite.AdminHandler.deleteSlide
This commit is contained in:
parent
1f2ab494dd
commit
5cc5fca6b5
|
@ -77,7 +77,7 @@ func (h *AdminHandler) carouselHandler(user *auth.User, company *auth.Company, c
|
||||||
case http.MethodPut:
|
case http.MethodPut:
|
||||||
editSlide(w, r, user, company, conn, f)
|
editSlide(w, r, user, company, conn, f)
|
||||||
case http.MethodDelete:
|
case http.MethodDelete:
|
||||||
h.deleteSlide(w, r, user, conn, typeSlug, mediaID)
|
deleteSlide(w, r, user, conn, typeSlug, mediaID)
|
||||||
default:
|
default:
|
||||||
httplib.MethodNotAllowed(w, r, http.MethodGet, http.MethodPut, http.MethodDelete)
|
httplib.MethodNotAllowed(w, r, http.MethodGet, http.MethodPut, http.MethodDelete)
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ func editSlide(w http.ResponseWriter, r *http.Request, user *auth.User, company
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *AdminHandler) deleteSlide(w http.ResponseWriter, r *http.Request, user *auth.User, conn *database.Conn, typeSlug string, mediaId int) {
|
func deleteSlide(w http.ResponseWriter, r *http.Request, user *auth.User, conn *database.Conn, typeSlug string, mediaId int) {
|
||||||
if err := user.VerifyCSRFToken(r); err != nil {
|
if err := user.VerifyCSRFToken(r); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusForbidden)
|
http.Error(w, err.Error(), http.StatusForbidden)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue