You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
575 B
29 lines
575 B
export function gSuccess(data = null, message = "success") {
|
|
if (typeof data === "string") {
|
|
return {
|
|
code: 200,
|
|
message: data,
|
|
data: null,
|
|
}
|
|
}
|
|
return {
|
|
code: 200,
|
|
message: message,
|
|
data: data,
|
|
}
|
|
}
|
|
|
|
export function gFail(data = null, message = "fail") {
|
|
if (typeof data === "string") {
|
|
return {
|
|
code: 400,
|
|
message: data,
|
|
data: null,
|
|
}
|
|
}
|
|
return {
|
|
code: 400,
|
|
message: message,
|
|
data: data,
|
|
}
|
|
}
|
|
|