feat(writeapi): user settings API

This commit is contained in:
Julian Lam
2020-10-22 14:07:45 -04:00
parent aab5f018b9
commit c26f2b6599
13 changed files with 277 additions and 132 deletions

View File

@@ -28,6 +28,16 @@ Users.deleteMany = async (req, res) => {
helpers.formatApiResponse(200, res);
};
Users.updateSettings = async (req, res) => {
const settings = await api.users.updateSettings(req, { ...req.body, uid: req.params.uid });
helpers.formatApiResponse(200, res, settings);
};
Users.updateSetting = async (req, res) => {
await api.users.updateSetting(req, { ...req.params, value: req.body.value });
helpers.formatApiResponse(200, res);
};
Users.changePassword = async (req, res) => {
await api.users.changePassword(req, { ...req.body, uid: req.params.uid });
helpers.formatApiResponse(200, res);