placementt-core 1.400.1084 → 1.400.1085

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/hooks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DocumentData, QueryConstraint, QueryDocumentSnapshot } from "firebase/firestore";
2
- import { AlumniConvoUser, ApplicantStage, Application, ArrowObject, CohortData, CSVExportResponse, CustomFormSchema, ExternalEvent, FileItem, FilterObject, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, ProviderData, QueryObject, QueryObjectConstraint, Sorts, StudentPlacementData, UserData, UserGroupData, WorkflowConfig, WorkflowStage } from "./typeDefinitions";
2
+ import { AlumniConvoUser, ApplicantStage, Application, ArrowObject, CohortData, CSVExportResponse, CustomFormSchema, ExternalEvent, FileItem, FilterObject, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, QueryObject, QueryObjectConstraint, Sorts, StudentPlacementData, UserData, UserGroupData, WorkflowConfig, WorkflowStage } from "./typeDefinitions";
3
3
  type StudentPlacementListParams = {
4
4
  user: UserData;
5
5
  student?: UserData;
@@ -332,17 +332,17 @@ export declare function useLazyLoadQueryList({ path, constraints, number, onItem
332
332
  export declare function useProposePlacementRenderer({ user, orgContext, placement }: {
333
333
  user: UserData;
334
334
  orgContext?: {
335
- details: InstituteData;
336
- userGroups: {
335
+ details?: InstituteData;
336
+ userGroups?: {
337
337
  [key: string]: UserGroupData;
338
338
  };
339
- placements: {
339
+ placements?: {
340
340
  [key: string]: StudentPlacementData;
341
341
  };
342
- forms: {
342
+ forms?: {
343
343
  [key: string]: unknown;
344
344
  };
345
- cohorts: {
345
+ cohorts?: {
346
346
  [key: string]: CohortData;
347
347
  };
348
348
  };
@@ -575,8 +575,8 @@ export declare function useGetIndividualPlacementForPlacementPage({ user, placem
575
575
  user: UserData;
576
576
  placementId: string;
577
577
  organisation?: {
578
- details: InstituteData | ProviderData;
579
- cohorts: {
578
+ details?: InstituteData;
579
+ cohorts?: {
580
580
  [key: string]: CohortData;
581
581
  };
582
582
  workflows?: {
package/lib/hooks.js CHANGED
@@ -2071,7 +2071,7 @@ function useProposePlacementRenderer({ user, orgContext, placement }) {
2071
2071
  return;
2072
2072
  }
2073
2073
  if (user.userType === "Staff" && orgContext) {
2074
- setCohort(orgContext.cohorts[student?.cohort]);
2074
+ setCohort(orgContext.cohorts?.[student?.cohort]);
2075
2075
  return;
2076
2076
  }
2077
2077
  setCohort(user.cohortData);
@@ -3020,7 +3020,7 @@ function useGetIndividualPlacementForPlacementPage({ user, placementId, organisa
3020
3020
  }
3021
3021
  if (placement.cohort) {
3022
3022
  if (user.product === "institutes" && user.oId === placement.oId) {
3023
- const cohortData = organisation?.cohorts[placement.cohort];
3023
+ const cohortData = organisation?.cohorts?.[placement.cohort];
3024
3024
  setCohort(cohortData);
3025
3025
  // Workflows live in their own collection - resolve from context when loaded, else fetch.
3026
3026
  if (organisation?.workflows) {