diff --git a/components/ledger/libs/api/utils.go b/components/ledger/libs/api/utils.go index 7bc5273220..72295acb4e 100644 --- a/components/ledger/libs/api/utils.go +++ b/components/ledger/libs/api/utils.go @@ -13,7 +13,6 @@ const ( defaultLimit = 15 ErrorCodeNotFound = "NOT_FOUND" - ErrorCodeAccepted = "ACCEPTED" ErrorInternal = "INTERNAL" ) @@ -27,10 +26,6 @@ func writeJSON(w http.ResponseWriter, statusCode int, v any) { } } -func Accepted(w http.ResponseWriter, v any) { - writeJSON(w, http.StatusAccepted, v) -} - func NotFound(w http.ResponseWriter, err error) { writeJSON(w, http.StatusNotFound, ErrorResponse{ ErrorCode: ErrorCodeNotFound, @@ -73,6 +68,11 @@ func InternalServerError(w http.ResponseWriter, r *http.Request, err error) { }) } +func Accepted(w http.ResponseWriter, v any) { + writeJSON(w, http.StatusAccepted, BaseResponse[any]{ + Data: &v, + }) +} func Created(w http.ResponseWriter, v any) { writeJSON(w, http.StatusCreated, BaseResponse[any]{ Data: &v, diff --git a/libs/go-libs/api/utils.go b/libs/go-libs/api/utils.go index 9ca5ad8a11..72295acb4e 100644 --- a/libs/go-libs/api/utils.go +++ b/libs/go-libs/api/utils.go @@ -26,10 +26,6 @@ func writeJSON(w http.ResponseWriter, statusCode int, v any) { } } -func Accepted(w http.ResponseWriter, v any) { - writeJSON(w, http.StatusAccepted, v) -} - func NotFound(w http.ResponseWriter, err error) { writeJSON(w, http.StatusNotFound, ErrorResponse{ ErrorCode: ErrorCodeNotFound, @@ -72,6 +68,11 @@ func InternalServerError(w http.ResponseWriter, r *http.Request, err error) { }) } +func Accepted(w http.ResponseWriter, v any) { + writeJSON(w, http.StatusAccepted, BaseResponse[any]{ + Data: &v, + }) +} func Created(w http.ResponseWriter, v any) { writeJSON(w, http.StatusCreated, BaseResponse[any]{ Data: &v,