diff --git a/back/api/cron.ts b/back/api/cron.ts index 37d58562..8babad4f 100644 --- a/back/api/cron.ts +++ b/back/api/cron.ts @@ -126,7 +126,7 @@ export default (app: Router) => { id: Joi.number().required(), }), }), - async (req: Request, res: Response, next: NextFunction) => { + async (req: Request<{ id: number }>, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const cronService = Container.get(CronService); @@ -242,10 +242,10 @@ export default (app: Router) => { '/:id', celebrate({ params: Joi.object({ - id: Joi.string().required(), + id: Joi.number().required(), }), }), - async (req: Request, res: Response, next: NextFunction) => { + async (req: Request<{ id: number }>, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const cronService = Container.get(CronService); diff --git a/back/api/dependence.ts b/back/api/dependence.ts index 07a481d5..22dba7a5 100644 --- a/back/api/dependence.ts +++ b/back/api/dependence.ts @@ -110,7 +110,7 @@ export default (app: Router) => { id: Joi.string().required(), }), }), - async (req: Request, res: Response, next: NextFunction) => { + async (req: Request<{ id: number }>, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const dependenceService = Container.get(DependenceService); diff --git a/back/api/env.ts b/back/api/env.ts index 6fa0785b..12e956d6 100644 --- a/back/api/env.ts +++ b/back/api/env.ts @@ -96,7 +96,7 @@ export default (app: Router) => { toIndex: Joi.number().required(), }), }), - async (req: Request, res: Response, next: NextFunction) => { + async (req: Request<{ id: number }>, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const envService = Container.get(EnvService); @@ -173,7 +173,7 @@ export default (app: Router) => { id: Joi.string().required(), }), }), - async (req: Request, res: Response, next: NextFunction) => { + async (req: Request<{ id: number }>, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const envService = Container.get(EnvService); diff --git a/back/api/open.ts b/back/api/open.ts index d707afca..1e09e9d7 100644 --- a/back/api/open.ts +++ b/back/api/open.ts @@ -90,7 +90,7 @@ export default (app: Router) => { id: Joi.string().required(), }), }), - async (req: Request, res: Response, next: NextFunction) => { + async (req: Request<{ id: number }>, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { const openService = Container.get(OpenService); diff --git a/back/services/dependence.ts b/back/services/dependence.ts index a23117f1..133e00de 100644 --- a/back/services/dependence.ts +++ b/back/services/dependence.ts @@ -60,7 +60,7 @@ export default class DependenceService { return docs[0]; } - public async remove(ids: string[]) { + public async remove(ids: number[]) { const [, docs] = await DependenceModel.update( { status: DependenceStatus.removing, log: [] }, { where: { id: ids } }, @@ -100,7 +100,7 @@ export default class DependenceService { } } - public async reInstall(ids: string[]): Promise { + public async reInstall(ids: number[]): Promise { const [, docs] = await DependenceModel.update( { status: DependenceStatus.installing, log: [] }, { where: { id: ids } }, @@ -114,7 +114,7 @@ export default class DependenceService { return docs; } - public async get(id: string): Promise { + public async get(id: number): Promise { const docs = await DependenceModel.findAll({ where: { id } }); return docs[0]; }