(req, res)
| 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}`); |
nothing calls this directly
no outgoing calls
no test coverage detected