From de419ce435bcad2d9d5971165284ebdbd6c36500 Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Sun, 25 Dec 2022 14:04:16 +0100 Subject: [PATCH] fix: set payload for settings --- src/routes/settings/findSetting.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/routes/settings/findSetting.ts b/src/routes/settings/findSetting.ts index 551b87771..75212d427 100644 --- a/src/routes/settings/findSetting.ts +++ b/src/routes/settings/findSetting.ts @@ -1,4 +1,3 @@ -import { captureException } from '@sentry/node'; import { Request, Response } from 'express'; import DB from '../../lib/storage/db'; @@ -11,15 +10,9 @@ export default async function findSetting(req: Request, res: Response) { return res.status(400).send(); } - await DB('settings') + const storedSettings = await DB('settings') .where({ object_id: id }) .returning(['payload']) - .first() - .then((result) => { - res.json(result); - }) - .catch((err) => { - captureException(err); - res.status(400).send(); - }); + .first(); + return res.json({ payload: storedSettings }); }