chore: marke change api call async

This commit is contained in:
arc-alex
2025-12-15 14:15:12 +01:00
committed by Carlos Valente
parent ba75d52d29
commit 6beda1575a
3 changed files with 10 additions and 18 deletions
@@ -27,7 +27,7 @@ integrationRouter.get('/', (_req: Request, res: Response<{ message: string }>) =
/**
* All calls are sent to the dispatcher
*/
integrationRouter.get('/*splat', (req: Request, res: Response<ErrorResponse | { payload: unknown }>) => {
integrationRouter.get('/*splat', async (req: Request, res: Response<ErrorResponse | { payload: unknown }>) => {
let action = req.path.substring(1);
if (!action) {
res.status(400).json({ message: 'No action found' });
@@ -45,7 +45,7 @@ integrationRouter.get('/*splat', (req: Request, res: Response<ErrorResponse | {
} else {
payload = query;
}
const reply = dispatchFromAdapter(action, payload, 'http');
const reply = await dispatchFromAdapter(action, payload, 'http');
res.status(202).json(reply);
} catch (error) {
const errorMessage = getErrorMessage(error);