mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 00:13:53 +00:00
chore: improve convention entry <> event
This commit is contained in:
@@ -8,13 +8,13 @@ import {
|
||||
addEvent,
|
||||
applyDelay,
|
||||
batchEditEvents,
|
||||
deleteAllEvents,
|
||||
deleteAllEntries,
|
||||
deleteEvent,
|
||||
editEvent,
|
||||
reorderEvent,
|
||||
reorderEntry,
|
||||
swapEvents,
|
||||
} from '../../services/rundown-service/RundownService.js';
|
||||
import { getEventWithId, getCurrentRundown } from '../../services/rundown-service/rundownUtils.js';
|
||||
import { getEntryWithId, getCurrentRundown } from '../../services/rundown-service/rundownUtils.js';
|
||||
|
||||
export async function rundownGetAll(_req: Request, res: Response<ProjectRundownsList>) {
|
||||
const rundown = getCurrentRundown();
|
||||
@@ -30,7 +30,7 @@ export async function rundownGetById(req: Request, res: Response<OntimeEntry | E
|
||||
const { eventId } = req.params;
|
||||
|
||||
try {
|
||||
const event = getEventWithId(eventId);
|
||||
const event = getEntryWithId(eventId);
|
||||
|
||||
if (!event) {
|
||||
res.status(404).send({ message: 'Event not found' });
|
||||
@@ -93,7 +93,7 @@ export async function rundownReorder(req: Request, res: Response<OntimeEntry | E
|
||||
|
||||
try {
|
||||
const { eventId, from, to } = req.body;
|
||||
const event = await reorderEvent(eventId, from, to);
|
||||
const event = await reorderEntry(eventId, from, to);
|
||||
res.status(200).send(event.newEvent);
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error);
|
||||
@@ -128,7 +128,7 @@ export async function rundownApplyDelay(req: Request, res: Response<MessageRespo
|
||||
|
||||
export async function rundownDelete(_req: Request, res: Response<MessageResponse | ErrorResponse>) {
|
||||
try {
|
||||
await deleteAllEvents();
|
||||
await deleteAllEntries();
|
||||
res.status(204).send({ message: 'All events deleted' });
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error);
|
||||
|
||||
Reference in New Issue
Block a user