Files
taskview-community/api/src/tv-modules/start/StartController.ts
T
2026-04-05 21:56:15 +02:00

22 lines
1.0 KiB
TypeScript

import type { Request, Response } from 'express';
export class StartController {
fetchAllLists = async (req: Request, res: Response) => {
const organizationId = req.query.organizationId ? Number(req.query.organizationId) : undefined;
return res.tvJson(await req.appUser.startManager.fetchAllLists(organizationId));
};
fetchAllState = async (req: Request, res: Response) => {
if (!req?.query?.tz) {
return res.status(400).send('tz is required');
}
const organizationId = req.query.organizationId ? Number(req.query.organizationId) : undefined;
return res.tvJson(await req.appUser.startManager.fetchAllState(req.query.tz as string, organizationId));
};
searchTaskInAllProjects = async (req: Request, res: Response) => {
const organizationId = req.query.organizationId ? Number(req.query.organizationId) : undefined;
return res.tvJson(await req.appUser.startManager.searchTaskInAllProjects(req?.query?.description as string, organizationId));
};
}