caio-imperial / caio-imperial/PHOTO-SITE-API
Move Images to Trash
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
# Objective
Implement funcitonality that allow users to delete images file. The Images should be stored in a specificed folder who has a name trash.
# Requirements:
- Allow users delete images.
- The Images goes to trash folder.
# Steps to Implement
1. Create a `POST` endpoint `/trash`
2. Send in body can be:
``` json
{
"image_ids": ["image_id_1", "image_id_2", "image_id_3"]
}
```
3. Check if each image_id exists in the database.
4. If an image_id is invalid (not found in the database), return a partial success response with the IDs that were successfully processed.
``` json
{
"message": "Some images could not be moved to trash.",
"trashed_images": ["image_id_1"],
"failed_images": ["image_id_3"]
}
```
6. Return the result of the operation, indicating which images were successfully moved to the trash and which were not.
```json
{
"message": "Images moved to trash successfully.",
"trashed_images": ["image_id_1", "image_id_2"],
"failed_images": []
}
```
7. Return error
```json
{
"message": "Invalid request.",
"error": "No image IDs provided."
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the TypeScript API entry point, the image database model, and the existing image-storage code. Add the POST /trash flow using the specified image_ids payload, then verify responses for successful moves, invalid IDs, and an empty request against the repository's available checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100