Skip to content

Commit

Permalink
fix: update existing resource in datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
deeonwuli committed Jan 13, 2025
1 parent d22196b commit c210e06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2025-01-13T12:50:10.915Z\n"
"PO-Revision-Date: 2025-01-13T12:50:10.915Z\n"
"POT-Creation-Date: 2025-01-13T12:53:26.908Z\n"
"PO-Revision-Date: 2025-01-13T12:53:26.908Z\n"

msgid "Low"
msgstr ""
Expand Down
4 changes: 1 addition & 3 deletions src/data/repositories/ResourceD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export class ResourceD2Repository implements ResourceRepository {
const resourceWithFileId = { ...resource, resourceFileId: resourceFileId };
const updatedResources = isResourceExisting
? resourcesInDataStore.map(resourceInDataStore =>
resourceInDataStore.resourceLabel === resource.resourceLabel
? resourceWithFileId
: resourceInDataStore
isResourceExisting ? resourceWithFileId : resourceInDataStore
)
: [...resourcesInDataStore, resourceWithFileId];
return updatedResources;
Expand Down

0 comments on commit c210e06

Please sign in to comment.