Open jean-michelet opened 3 weeks ago
Hi can I be assigned this issue?
Hi!
Go ahead!
I'm looking through the codebase and correct me if I'm wrong - I suspect that the fastify.post
found in demo/src/routes/api/tasks/index.ts
is the endpoint to be changed?
This is POST /:id/upload
.
We store the filename in the tasks
table in db for later retrieval.
Look how we do store the file and you will know how to check if there is already an existing file.
When we retrieve a task, we must first look if a file with name = task.filename
exists in the upload directory.
But you should delete the file after the db operations.
Understood, I believe I have an idea on where to put the deletion. I'll open a PR hopefully tomorrow morning/afternoon. Thank you!
When uploading a task image, we should look if there is already a file associated, and remove it.