feat: add api controllers and routes for browser extension

This commit is contained in:
Sonny
2025-08-28 16:44:31 +02:00
parent 9aa71dad30
commit 208f2c631f
28 changed files with 353 additions and 5 deletions

View File

@@ -36,6 +36,13 @@ export default class HttpExceptionHandler extends ExceptionHandler {
* response to the client
*/
async handle(error: unknown, ctx: HttpContext) {
if (ctx.request.url()?.startsWith('/api/v1')) {
return ctx.response.status(400).json({
message: 'Bad Request',
errors: [error],
});
}
if (error instanceof errors.E_ROW_NOT_FOUND) {
return ctx.response.redirectToNamedRoute('dashboard');
}