Skip to content

Commit ec766ee

Browse files
authored
fix: syntax issue with sql (#2730)
1 parent 187b14d commit ec766ee

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

extensions/extensionController/src/ExtensionController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class ExtensionController {
151151
);
152152
}
153153
}
154-
await route.handler.bind(this)(req, res, next);
154+
return await route.handler.bind(this)(req, res, next);
155155
} catch ( error ) {
156156
if ( error instanceof HttpError ) {
157157
res.status(error.statusCode).send({ error: error.message });

extensions/installedApps/src/controllers/InstalledAppsController.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class InstalledAppsController extends ExtensionController {
2727
async getInstalledApps (req: Request<null, null, null, { orderBy: string, desc: boolean, page: number, limit: number }>, res: Response): Promise<void> {
2828
const actor = req.actor;
2929
if ( ! actor ) {
30-
throw Error('actor not found in context');
30+
throw new HttpError(401, 'actor not found in context');
3131
}
3232
if ( actor.type.app ) {
3333
throw new HttpError(403, 'Apps are not allowed to access this resource');
@@ -49,15 +49,15 @@ export class InstalledAppsController extends ExtensionController {
4949
apps.uid,
5050
apps.title,
5151
apps.description,
52-
MIN(perm.dt) AS installed_at,
52+
MIN(perm.dt) AS installed_at
5353
FROM apps
5454
LEFT JOIN user_to_app_permissions AS perm ON apps.id = perm.app_id
5555
WHERE perm.user_id = ?
5656
GROUP BY apps.id, apps.name, apps.uid, apps.title, apps.description
5757
ORDER BY ${orderByField} ${sortDirection}
5858
LIMIT ?
5959
OFFSET ?`,
60-
[actor.type.user.id, actor.type.user.id, limit, offset],
60+
[actor.type.user.id, limit, offset],
6161
) as {
6262
name: string;
6363
uid: string;

0 commit comments

Comments
 (0)