Skip to content

Commit

Permalink
Merge pull request #9 from htoann/test-api
Browse files Browse the repository at this point in the history
fix(api): response message
  • Loading branch information
htoann authored Oct 30, 2022
2 parents 8f43132 + 4c6f275 commit 318d6e0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions server/src/utils/createMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@ export const createError = (res, status, message) => {
const err = new Error();
err.status = status || 500;
err.message = message || "Something went wrong";
return res.status(status).send({
data: {
status,
message,
},
return res.send({
status,
message,
});
};

export const createMessage = (res, status, message) => {
const err = new Error();
err.status = status || 200;
err.message = message || "Successfully";
return res.status(status).send({
data: {
status,
message,
},
return res.send({
status,
message,
});
};

0 comments on commit 318d6e0

Please sign in to comment.