MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / deleteUserStatus

Function deleteUserStatus

controllers/userStatus.js:19–37  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

17 *
18 */
19
20const deleteUserStatus = async (req, res) => {
21 try {
22 const { userId } = req.params;
23 const deletedUserStatus = await userStatusModel.deleteUserStatus(userId);
24 const responseObj = { id: deletedUserStatus.id, userId };
25 let statusCode;
26 if (deletedUserStatus.userStatusExisted) {
27 responseObj.message = "User Status deleted successfully.";
28 statusCode = 200;
29 } else {
30 responseObj.message = "User Status to delete not found.";
31 statusCode = 404;
32 }
33 return res.status(statusCode).json(responseObj);
34 } catch (error) {
35 logger.error(`Error while deleting User Status: ${error}`);
36 return res.boom.badImplementation(INTERNAL_SERVER_ERROR);
37 }
38};
39
40/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected