summary refs log tree commit diff
path: root/api/src/routes/users/@me/settings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/routes/users/@me/settings.ts')
-rw-r--r--api/src/routes/users/@me/settings.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/routes/users/@me/settings.ts b/api/src/routes/users/@me/settings.ts
index f045a010..90ee6372 100644
--- a/api/src/routes/users/@me/settings.ts
+++ b/api/src/routes/users/@me/settings.ts
@@ -1,5 +1,5 @@
 import { Router, Response, Request } from "express";
-import { UserModel, UserSettings } from "@fosscord/util";
+import { User, UserSettings } from "@fosscord/util";
 import { check } from "../../../util/instanceOf";
 import { UserSettingsSchema } from "../../../schema/User";
 
@@ -9,7 +9,7 @@ router.patch("/", check(UserSettingsSchema), async (req: Request, res: Response)
 	const body = req.body as UserSettings;
 
 	// only users can update user settings
-	await UserModel.updateOne({ id: req.user_id, bot: false }, body).exec();
+	await User.update({ id: req.user_id, bot: false }, { settings: body });
 
 	res.sendStatus(204);
 });