Skip to content

Commit

Permalink
Use userID in dataset details sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
jernestmyers committed Oct 23, 2023
1 parent c0ed647 commit 82449d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,7 @@ export function loadUserDatasetDetail(id: string, loadedProjectId?: string) {
.map((d) => ({
userDisplayName:
d.recipient.firstName + ' ' + d.recipient.lastName,
// TODO: need a way to pass in the unique userId in details
user: 378138370,
user: d.recipient.userID,
})),
};
return detailReceived(id, transformedResponse);
Expand Down
9 changes: 5 additions & 4 deletions packages/libs/user-datasets/src/lib/Utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,11 @@ const visibilityOptions = keyof({
public: null,
});

const userDatasetListShareDetails = type({
const userDatasetRecipientDetails = type({
userID: number,
firstName: string,
lastName: string,
organization: string,
accepted: boolean,
});

export const userDataset = intersection([
Expand All @@ -256,14 +255,16 @@ export const userDataset = intersection([
summary: string,
description: string,
sourceUrl: string,
shares: array(userDatasetListShareDetails),
shares: array(
intersection([userDatasetRecipientDetails, type({ accepted: boolean })])
),
importMessages: array(string),
}),
]);

const userDatasetDetailsShareDetails = type({
status: keyof({ grant: null, revoke: null }),
recipient: userMetadata,
recipient: userDatasetRecipientDetails,
});

export const userDatasetDetails = intersection([
Expand Down

0 comments on commit 82449d4

Please sign in to comment.