mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 08:23:55 +00:00
refactor: small cleanups (#2059)
* refactor: remove unneeded async * chore: add express Router type to all routes * refactor: don't use index in react key * refactor: correctly get error message in excel route * refactor: avoid exporting muteable values
This commit is contained in:
committed by
GitHub
parent
23a44b2f04
commit
7c1d2f4554
@@ -1,5 +1,5 @@
|
||||
import express from 'express';
|
||||
import type { Request, Response } from 'express';
|
||||
import type { Request, Response, Router } from 'express';
|
||||
import { CustomField, CustomFields, ErrorResponse } from 'ontime-types';
|
||||
import { getErrorMessage } from 'ontime-utils';
|
||||
|
||||
@@ -8,12 +8,12 @@ import { getProjectCustomFields } from '../rundown/rundown.dao.js';
|
||||
import { createCustomField, deleteCustomField, editCustomField } from '../rundown/rundown.service.js';
|
||||
import { validateCustomField, validateDeleteCustomField, validateEditCustomField } from './customFields.validation.js';
|
||||
|
||||
export const router = express.Router();
|
||||
export const router: Router = express.Router();
|
||||
|
||||
/**
|
||||
* Gets all the custom fields for the project
|
||||
*/
|
||||
router.get('/', async (_req: Request, res: Response<CustomFields>) => {
|
||||
router.get('/', (_req: Request, res: Response<CustomFields>) => {
|
||||
const customFields = getProjectCustomFields();
|
||||
res.status(200).json(customFields);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user