diff --git a/api/lib/types.ts b/api/lib/types.ts index 262128b6f..81113f07a 100644 --- a/api/lib/types.ts +++ b/api/lib/types.ts @@ -81,7 +81,9 @@ export const LayerAlertResponse = createSelectSchema(schemas.LayerAlert, { export const ImportResponse = createSelectSchema(schemas.Import, {}); -export const TaskResponse = createSelectSchema(schemas.Task, {}); +export const TaskResponse = createSelectSchema(schemas.Task, { + id: Type.Integer(), +}); export const IconsetResponse = createSelectSchema(schemas.Iconset, { version: Type.Integer(), diff --git a/api/routes/task.ts b/api/routes/task.ts index 4980de312..bdd9c13b2 100644 --- a/api/routes/task.ts +++ b/api/routes/task.ts @@ -188,12 +188,12 @@ export default async function router(schema: Schema, config: Config) { } }); - await schema.get('/task/prefix/:prefix/readme', { + await schema.get('/task/prefix/:task/readme', { name: 'Task README', group: 'Task', description: 'Return README Contents', params: Type.Object({ - prefix: Type.String() + task: Type.Integer() }), res: Type.Object({ body: Type.String() @@ -202,7 +202,7 @@ export default async function router(schema: Schema, config: Config) { try { await Auth.as_user(config, req); - const task = await config.models.Task.from(req.params.prefix); + const task = await config.models.Task.from(req.params.task); if (task.readme) { const readmeres = await fetch(task.readme);