chore: cleanup

This commit is contained in:
Carlos Valente
2024-04-21 23:11:58 +02:00
committed by Carlos Valente
parent 8f249b9d51
commit 5cf5b2fae3
4 changed files with 4 additions and 16 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ export class SocketServer implements IAdapter {
if (reply) {
ws.send(
JSON.stringify({
type: 'ontime-change',
type,
payload: reply.payload,
}),
);
@@ -56,7 +56,6 @@ const actionHandlers: Record<string, ActionHandler> = {
});
updateEvent(patchEvent);
Object.assign(patchEvent);
return { payload: 'success' };
},
@@ -75,7 +74,7 @@ const actionHandlers: Record<string, ActionHandler> = {
/* Playback */
start: (payload) => {
if (payload === undefined) {
return successPayloadOrError(runtimeService.start(), 'Uable to start');
return successPayloadOrError(runtimeService.start(), 'Unable to start');
}
if (payload && typeof payload === 'object') {
@@ -5,7 +5,7 @@
*
*/
import { ErrorResponse, LogOrigin, RuntimeStore } from 'ontime-types';
import { LogOrigin } from 'ontime-types';
import express, { type Request, type Response } from 'express';
@@ -14,7 +14,6 @@ import { integrationPayloadFromPath } from '../adapters/utils/parse.js';
import { dispatchFromAdapter } from './integration.controller.js';
import { getErrorMessage } from 'ontime-utils';
import { eventStore } from '../stores/EventStore.js';
import { isEmptyObject } from '../utils/parserUtils.js';
export const integrationRouter = express.Router();
@@ -52,13 +51,3 @@ integrationRouter.get('/*', (req: Request, res: Response) => {
res.status(500).send({ message: errorMessage });
}
});
integrationRouter.get('/poll', (_req: Request, res: Response<Partial<RuntimeStore> | ErrorResponse>) => {
try {
const state = eventStore.poll();
res.status(200).send(state);
} catch (error) {
const message = getErrorMessage(error);
res.status(500).send({ message: `Could not get sync data: ${message}` });
}
});
@@ -10,7 +10,7 @@ const whitelistedPayload = {
note: coerceString,
cue: coerceString,
duration: (value: unknown) => coerceNumber(value) * 1000, //frontend is seconds based
duration: (value: unknown) => coerceNumber(value) * 1000,
isPublic: coerceBoolean,
skip: coerceBoolean,