Skip to content

Commit 17ec645

Browse files
authored
Merge pull request #127 from cap-js/FixBugRandomNameInEntityKey
Fix bug when Entity's primary key is not ID
2 parents 0617503 + ee698f9 commit 17ec645

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
1010
- Handling of special characters in attachments name during upload and rename of attachments.
1111

1212
### Fixed
13+
- Error to allow any name in the primary key for the entity.
1314
- Issue with deleting attachments from SDM when the entity has not been saved once.
1415
- Error message in case of rename when attachment is deleted from backend SDM repository.
1516

lib/persistence/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ async function getFolderIdForEntity(attachments, req, repositoryId) {
4040
}
4141

4242
async function updateAttachmentInDraft(req, data) {
43-
const up_ = req.target.keys.up_.keys[0].$generatedFieldName;
44-
const idValue = up_.split("__")[1];
4543
return await UPDATE(req.target)
4644
.set({ folderId: data.folderId, url: data.url, status: "Clean" })
47-
.where({ [idValue]: req.data[idValue] });
45+
.where({ ["ID"]: req.data["ID"] });
4846
}
4947

5048
async function getURLsToDeleteFromAttachments(deletedAttachments, attachments) {

0 commit comments

Comments
 (0)