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

Function updateAllUserStatus

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

Source from the content-addressed store, hash-verified

145 const updateStatus = await userStatusModel.updateUserStatus(userId, dataToUpdate);
146 const { userStatusExists, id, data } = updateStatus;
147 const responseObject = { id, userId, data: null, message: "" };
148 let statusCode;
149 if (data) responseObject.data = data;
150 if (userStatusExists) {
151 responseObject.message = "User Status updated successfully.";
152 statusCode = 200;
153 } else {
154 statusCode = 201;
155 responseObject.message = "User Status created successfully.";
156 }
157 return res.status(statusCode).json(responseObject);
158 }
159 return res.boom.badImplementation("The User doesn't exist.");
160 } catch (err) {
161 logger.error(`Error while updating the User Data: ${err}`);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected