acmpesuecc / acmpesuecc/timetracker-server

Implement delete record

Offen
#2 7 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @komulannister Auf GitHub ansehen
bounty 50 enhancement good first issue help wanted
Vorherrschende Sprache
TypeScript
Sterne
0
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# Implement the DeleteRecord Endpoint

## Description
This issue outlines the conditions of satisfaction for implementing the `DeleteRecord` endpoint in the project. The goal is to create a fully functional endpoint that can delete a record if and only if it is the last record in the database table.

## Conditions of Satisfaction

1. **Functionality**: The `DeleteRecord` endpoint must be fully functional, and it should return a Boolean value, specifically True if the operation is successful and False if it's not.

2. **Input Validation**: The endpoint should accept a single integer as input, which represents the record ID to be deleted. It should include appropriate input validation to ensure that the input is valid and corresponds to an existing record in the database.

3. **Last Record Check**: The record should only be deleted if it's the last record in the database table. If it's not the last record, the endpoint should not proceed with the deletion and should return False.

4. **Database Query in DAO**: The implementation should include a dedicated database query within the Data Access Object (DAO) located in `src/dao/records.ts`. This query should be structured to find and delete the record by its ID only if it's the last record.

5. **Function Execution**: A function or method within the `src/records.tsx` file should be created to handle the execution of the `DeleteRecord` endpoint. This function should provide a user-friendly and intuitive way to initiate the delete operation when certain conditions are met, ensuring that it's invoked appropriately and returns meaningful feedback to the user or application.

6. **Error Handling**: Adequate error handling should be in place. In the event of an error during the deletion operation, the endpoint should provide informative error messages.

7. **Integration**: Finally, the `DeleteRecord` function should be integrated into the `src/index.tsx` file, just like other mutations, allowing it to be part of the overall functionality of the application.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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