chore: use inventory projection for saveSettingsController

This commit is contained in:
Sainan 2025-03-27 12:49:26 +01:00
parent 2516af9acc
commit 2b9eb1844d

View File

@ -13,7 +13,7 @@ const saveSettingsController: RequestHandler = async (req, res): Promise<void> =
const settingResults = getJSONfromString<ISaveSettingsRequest>(String(req.body));
const inventory = await getInventory(accountId);
const inventory = await getInventory(accountId, "Settings");
inventory.Settings = Object.assign(inventory.Settings ?? {}, settingResults.Settings);
await inventory.save();
res.json({ Settings: inventory.Settings });