0xironclad / 0xironclad/Task-Scheduler-API

Implement DELETE /tasks/:id

未关闭 适合新手
#11 1 条评论 0 个 reaction 已指派 1 人 已被 @0xironclad 认领 在 GitHub 查看
api good first issue
主要语言
TypeScript
星标
0
派生
2
PR 合并指标
30 天内没有已合并 PR

描述

Implement an endpoint that removes a task by ID.

What to implement

- Route: DELETE /tasks/:id

- Validate that id is a valid number.

- Delete the task from app.tasks table.

- Return 204 No Content on success.

- Return 404 if the task does not exist.

Expected result
The task is removed from the database, and any related task_logs (via ON DELETE CASCADE) are cleaned up automatically.
You actually do not need any extra logic for the task logs part, postgresql will handle that part 💯

贡献指南

这个仓库没有索引到贡献指南

调研方向

Look for the existing task routes (likely in a routes/ or controllers/ directory) to see the pattern for GET/POST endpoints. The database model for tasks (app.tasks) will be defined in a model or schema file. Add a DELETE route handler that validates the ID, performs the deletion, and returns the correct HTTP status codes (204 or 404). Test the endpoint with a tool like curl or Postman.

由索引模型根据 Issue 内容生成。

评估

技术栈
express, node.js, postgresql, typescript
领域
api, backend, database
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。