From ec944fa69f62000274e94f746f5e5eeab2cf51e2 Mon Sep 17 00:00:00 2001 From: Abhishek Agagrwal Date: Sun, 3 Sep 2023 22:48:02 -0700 Subject: [PATCH 1/2] replicated VolunteerDetailsAPIData structure into a minimal structure --- common/components/utils/ProjectAPIUtils.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/common/components/utils/ProjectAPIUtils.js b/common/components/utils/ProjectAPIUtils.js index 36ceca775..ad4345977 100644 --- a/common/components/utils/ProjectAPIUtils.js +++ b/common/components/utils/ProjectAPIUtils.js @@ -109,6 +109,20 @@ export type VolunteerDetailsAPIData = {| +isUpForRenewal: boolean, |}; +// Structure for minimal volunteer data exposure +export type VolunteerMinimalDetailsAPIData = {| + +application_id: number, + +user: VolunteerUserData, + +application_text: string, + +application_date: string, + +platform_date_joined: string, + +roleTag: TagDefinition, + +isApproved: boolean, + +isCoOwner: boolean, + +isTeamLeader: boolean, + +isUpForRenewal: boolean, +|}; + export type ProjectDetailsAPIData = {| +project_id: number, +project_description: string, @@ -136,7 +150,7 @@ export type ProjectDetailsAPIData = {| +project_links: $ReadOnlyArray, +project_files: $ReadOnlyArray, +project_owners: $ReadOnlyArray, - +project_volunteers: $ReadOnlyArray, + +project_volunteers: $ReadOnlyArray, +project_date_modified: Date, +project_events: $ReadOnlyArray, +event_created_from: ?number, From 35572d1f5942d9a11105fb5a5be2b005388498fa Mon Sep 17 00:00:00 2001 From: Abhishek Agagrwal Date: Sun, 3 Sep 2023 22:54:51 -0700 Subject: [PATCH 2/2] Removed unnecessary sensitive fields from the VolunteerMinimalDetailsAPIData structure --- common/components/utils/ProjectAPIUtils.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/common/components/utils/ProjectAPIUtils.js b/common/components/utils/ProjectAPIUtils.js index ad4345977..d9a2501b5 100644 --- a/common/components/utils/ProjectAPIUtils.js +++ b/common/components/utils/ProjectAPIUtils.js @@ -113,14 +113,7 @@ export type VolunteerDetailsAPIData = {| export type VolunteerMinimalDetailsAPIData = {| +application_id: number, +user: VolunteerUserData, - +application_text: string, - +application_date: string, - +platform_date_joined: string, +roleTag: TagDefinition, - +isApproved: boolean, - +isCoOwner: boolean, - +isTeamLeader: boolean, - +isUpForRenewal: boolean, |}; export type ProjectDetailsAPIData = {|