소스 검색

allow delete method in Success function

Wendell Sun 5 년 전
부모
커밋
3683ea3bb5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      request/request.go

+ 1
- 1
request/request.go 파일 보기

@@ -55,7 +55,7 @@ func Success(ctx *gin.Context, data interface{}) {
55 55
 	}
56 56
 
57 57
 	switch ctx.Request.Method {
58
-	case http.MethodGet, http.MethodHead, http.MethodOptions:
58
+	case http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodDelete:
59 59
 		ctx.JSON(http.StatusOK, data)
60 60
 	case http.MethodPost, http.MethodPut, http.MethodPatch:
61 61
 		ctx.JSON(http.StatusCreated, data)