Get rid of some anys.

This commit is contained in:
baldo 2022-07-28 13:49:22 +02:00
parent 5592892f0d
commit d783bb634f
6 changed files with 53 additions and 76 deletions

View file

@ -10,6 +10,7 @@ import {isMonitoringToken, JSONObject, MonitoringResponse, MonitoringToken, toMo
const isValidToken = forConstraint(CONSTRAINTS.token, false);
// FIXME: Get rid of any
async function doGetAll(req: Request): Promise<{ total: number, result: any }> {
const restParams = await Resources.getValidRestParams('list', null, req);
const {monitoringStates, total} = await MonitoringService.getAll(restParams);

View file

@ -10,18 +10,18 @@ import {isString, isTaskSortField} from "../types";
const isValidId = forConstraint(CONSTRAINTS.id, false);
interface TaskResponse {
id: number,
name: string,
description: string,
schedule: string,
runningSince: number | null,
lastRunStarted: number | null,
lastRunDuration: number | null,
state: string,
result: string | null,
message: string | null,
enabled: boolean,
type TaskResponse = {
id: number;
name: string;
description: string;
schedule: string;
runningSince: number | null;
lastRunStarted: number | null;
lastRunDuration: number | null;
state: string;
result: string | null;
message: string | null;
enabled: boolean;
}
function toTaskResponse(task: Task): TaskResponse {