Fix file upload not returning uploaded file

Fixes #483
This commit is contained in:
rijkvanzanten
2020-10-02 17:19:05 -04:00
parent f57b542c4d
commit 30a34bce27

View File

@@ -113,8 +113,9 @@ router.post(
try {
const record = await service.readByKey(keys as any, req.sanitizedQuery);
res.locals.payload = {
data: res.locals.savedFiles.length === 1 ? record![0] : record || null,
data: record,
};
} catch (error) {
if (error instanceof ForbiddenException) {
@@ -201,7 +202,8 @@ router.get(
const record = await service.readByKey(keys as any, req.sanitizedQuery);
res.locals.payload = { data: record || null };
return next();
})
}),
respond
);
router.patch(