mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +00:00
refactor: improve return of reorder
This commit is contained in:
@@ -86,15 +86,15 @@ export async function rundownBatchPut(req: Request, res: Response<MessageRespons
|
||||
}
|
||||
}
|
||||
|
||||
export async function rundownReorder(req: Request, res: Response<OntimeEntry | ErrorResponse>) {
|
||||
export async function rundownReorder(req: Request, res: Response<Rundown | ErrorResponse>) {
|
||||
if (failEmptyObjects(req.body, res)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const { eventId, from, to } = req.body;
|
||||
const event = await reorderEntry(eventId, from, to);
|
||||
res.status(200).send(event.newEvent);
|
||||
const newRundown = await reorderEntry(eventId, from, to);
|
||||
res.status(200).send(newRundown);
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error);
|
||||
res.status(400).send({ message });
|
||||
|
||||
Reference in New Issue
Block a user