mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
chore: marke change api call async
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user