Skip to content

Conversation

RoshniNaveenaS
Copy link
Contributor

This PR introduces support in the @cap-js/attachments plugin to work with custom key names (not just ID) for entities using the attachments composition. It enables both draft and non-draft flows to work correctly when the key field is named differently (e.g., bookId, customId, etc.).

Fixes #209

…params

Rewrote the nonDraftUpload function to avoid assuming the key name is ID. It now uses req.params[1] to access the correct key-value pairs for the Attachments entity. This makes the non-draft upload logic fully compatible with entities using custom key names instead of hardcoded ID.
Replaced the usage of hardcoded regex parsing in readAttachment with CAP’s req.params array to dynamically extract key values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Version: 2.1.2] issue deleting draft entity with a key that is not called ID
1 participant