Skip to content

Commit

Permalink
Fix unit await
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jun 16, 2024
1 parent 076811e commit 061b6ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controllers/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export default function () {
var router = express.Router();
router.get('/', async function (req, res, next) {
try {
res.json(unitExec.get(req.path));
res.json(await unitExec.get(req.path));
} catch (error) {
next(error);
}
});
router.post('/', async function (req, res, next) {
try {
res.json(unitExec.set(req.path, JSON.stringify(req.body)));
res.json(await unitExec.set(req.path, JSON.stringify(req.body)));
} catch (error) {
next(error);
}
Expand Down

0 comments on commit 061b6ce

Please sign in to comment.