Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 3cf056f

Browse files
author
tkostuch
committed
update error message
1 parent bd9750e commit 3cf056f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/lib/util.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ export function apiStatus (res, result = 'OK', code = 200, meta = null) {
8383
* @param {number} [code=200] Status code to send on success
8484
* @param {json} [result='OK'] Text message or result information object
8585
*/
86-
export function apiError (res, errorObj, code = 500) {
87-
return apiStatus(res, errorObj.errorMessage ? errorObj.errorMessage : errorObj, errorObj.code ? errorObj.code : 500)
86+
export function apiError (res, errorObj) {
87+
const errorCode = errorObj.code || errorObj.status || 500
88+
const errorMessage = errorObj.errorMessage || errorObj
89+
return apiStatus(res, errorMessage, errorCode)
8890
}
8991

9092
export function encryptToken (textToken, secret) {

src/models/order.schema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ exports.default = {
142142
type: 'number'
143143
},
144144
save_address: {
145-
type: 'number'
145+
type: 'number'
146146
}
147147
}
148148
},
@@ -208,7 +208,7 @@ exports.default = {
208208
type: 'number'
209209
},
210210
save_address: {
211-
type: 'number'
211+
type: 'number'
212212
}
213213
}
214214
}

0 commit comments

Comments
 (0)