Content
View differences
Updated by Pavel Balashou over 3 years ago
Changes in API behavior: TODO:
* Introduce a new endpoint `POST /api/v3/file_links`.
* The request/response signature is similar to `POST /api/v3/work_packages/{id}/file_links`, but there is no work\_package known during the request time. Therefore, we create a file\_link without a container add necessary migrations (container id and respond without a container link.
* Implementation notes:
* to type can be able to create file\_links without a known container we have to remove not null constraints from the `file_links.container_id` and `file_links.container_type` database columns.
`null`)
* we have add cleanup of uncontainered file links to cover a case when file\_links has been created, but work\_package create form has never been confirmed. To do it we can introduce a cron job for cleaning up.
`app/workers/attachments/cleanup_uncontainered_job.rb` - the (same one like for handle a similar case for attachments.
* Modify `POST` [`https://openproject.local/api/v3/work_packages`](https://openproject.local/api/v3/work_packages)
* It should accept a list of file\_links by analogy to attachments. And respond with them afterwards.
* Implementation note: the file\_links have to be bound to a container (work\_package in this case). The logic for attachments bindings is located in `app/services/attachments/set_replacements.rb` attachments?)
* Introduce a new endpoint `POST /api/v3/file_links`.
* The request/response signature is similar to `POST /api/v3/work_packages/{id}/file_links`, but there is no work\_package known during the request time. Therefore, we create a file\_link without a container
* Implementation notes:
* to
`app/workers/attachments/cleanup_uncontainered_job.rb` - the
* Modify `POST` [`https://openproject.local/api/v3/work_packages`](https://openproject.local/api/v3/work_packages)
* It should accept a list of file\_links by analogy to attachments. And respond with them afterwards.
* Implementation note: the file\_links have to be bound to a container (work\_package in this case). The logic for attachments bindings is located in `app/services/attachments/set_replacements.rb`