Skip to content

Commit

Permalink
BUG Fix for save
Browse files Browse the repository at this point in the history
  • Loading branch information
loeiks committed Aug 6, 2024
1 parent c892e46 commit 0c81416
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exweiv/weiv-data",
"version": "4.9.4",
"version": "4.9.5",
"description": "Custom API Library for Wix sites to connect MongoDB. Designed to easily switch from wix-data APIs.",
"main": "./lib/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions app/src/Functions/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export async function save(collectionId: CollectionID, item: Item, options?: Wei
});

if (editedResult) {
return convertIds ? { item: convertDocumentIDs(editedResult) } : { item: editedResult };
return convertIds ? { item: convertDocumentIDs(editedResult), upsertedId: editedResult._id } : { item: editedResult, upsertedId: editedResult._id };
} else {
return convertIds ? { item: convertDocumentIDs(returnedItem) } : { item: returnedItem };
return convertIds ? { item: convertDocumentIDs(returnedItem), upsertedId: returnedItem._id } : { item: returnedItem, upsertedId: returnedItem._id };
}
} else if (actionType === "update") {
// Item Updated
Expand Down

0 comments on commit 0c81416

Please sign in to comment.