0xironclad / 0xironclad/Task-Scheduler-API

Implement DELETE /tasks/:id

Offen Anfängerfreundlich
#11 1 Kommentar 0 Reaktionen 1 zugewiesene Person Beansprucht von @0xironclad Auf GitHub ansehen
api good first issue
Vorherrschende Sprache
TypeScript
Sterne
0
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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 💯

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
express, node.js, postgresql, typescript
Bereich
api, backend, database
Issue-Typ
Feature
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.