Skip to content

Commit

Permalink
Refactor Dandiset data handling in StarredDandisetsView
Browse files Browse the repository at this point in the history
Simplified the mapping of Dandiset objects by directly returning the original Dandiset instead of creating a shallow copy and removing specific properties. This change improves code clarity and maintains the integrity of the Dandiset data structure.
  • Loading branch information
bendichter committed Dec 26, 2024
1 parent 3122129 commit a44586d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions web/src/views/StarredDandisetsView/StarredDandisetsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ export default defineComponent({
.map((dandiset: Dandiset) => {
const version = dandiset.most_recent_published_version || dandiset.draft_version;
if (!version) return null;
const rest = { ...dandiset };
delete rest.most_recent_published_version;
delete rest.draft_version;
return {
...version,
dandiset: rest,
dandiset,
};
})
.filter((item): item is NonNullable<typeof item> => item !== null);
Expand Down

0 comments on commit a44586d

Please sign in to comment.