Skip to content

Commit

Permalink
fix: set payload for settings
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Dec 25, 2022
1 parent 6a48076 commit de419ce
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/routes/settings/findSetting.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { captureException } from '@sentry/node';
import { Request, Response } from 'express';

import DB from '../../lib/storage/db';
Expand All @@ -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 });
}

0 comments on commit de419ce

Please sign in to comment.