catchup-library-web 2.2.26 → 2.2.27

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/dist/index.d.mts CHANGED
@@ -890,7 +890,11 @@ declare const filterGradeLevelOptionList: (institutionDTO: any, gradeDTO: any) =
890
890
  value: number;
891
891
  text: string;
892
892
  }[];
893
- declare const filterCoterieTypeOptionList: (userInformation: any, userProfile: any, userProfileInstitution: any) => any;
893
+ declare const filterCoterieTypeOptionList: (coterieType: any, institutionType: any) => {
894
+ text: string;
895
+ value: string;
896
+ includes: string[];
897
+ }[];
894
898
  declare const filterCoterieTypeByDistinctOptionList: (distinctCoterieTypeOptionList: any[]) => {
895
899
  text: string;
896
900
  value: string;
package/dist/index.d.ts CHANGED
@@ -890,7 +890,11 @@ declare const filterGradeLevelOptionList: (institutionDTO: any, gradeDTO: any) =
890
890
  value: number;
891
891
  text: string;
892
892
  }[];
893
- declare const filterCoterieTypeOptionList: (userInformation: any, userProfile: any, userProfileInstitution: any) => any;
893
+ declare const filterCoterieTypeOptionList: (coterieType: any, institutionType: any) => {
894
+ text: string;
895
+ value: string;
896
+ includes: string[];
897
+ }[];
894
898
  declare const filterCoterieTypeByDistinctOptionList: (distinctCoterieTypeOptionList: any[]) => {
895
899
  text: string;
896
900
  value: string;
package/dist/index.js CHANGED
@@ -8929,42 +8929,20 @@ var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
8929
8929
  }
8930
8930
  return retrieveGradeLevelOptionList();
8931
8931
  };
8932
- var filterCoterieTypeOptionList = (userInformation, userProfile, userProfileInstitution) => {
8933
- if (userInformation.accountType === "GENIXO") {
8934
- return retrieveCoterieTypeOptionList().sort(
8935
- (a, b) => a.text.localeCompare(b.text)
8936
- );
8937
- }
8938
- if (userProfile.role === "STAFF" || userProfile.role === "CONTENT_CREATOR") {
8939
- if (userProfile.coterieType === "MANAGEMENT") {
8940
- if (userProfileInstitution) {
8941
- return retrieveCoterieTypeOptionList().filter(
8942
- (coterieTypeOption) => coterieTypeOption.includes.includes(userProfileInstitution.type)
8943
- ).sort((a, b) => a.text.localeCompare(b.text));
8944
- } else {
8945
- return retrieveCoterieTypeOptionList().sort(
8946
- (a, b) => a.text.localeCompare(b.text)
8947
- );
8948
- }
8949
- } else {
8932
+ var filterCoterieTypeOptionList = (coterieType, institutionType) => {
8933
+ if (coterieType === "MANAGEMENT") {
8934
+ if (institutionType) {
8950
8935
  return retrieveCoterieTypeOptionList().filter(
8951
- (coterieTypeOption) => coterieTypeOption.value === userProfile.coterieType
8936
+ (coterieTypeOption) => coterieTypeOption.includes.includes(institutionType)
8952
8937
  ).sort((a, b) => a.text.localeCompare(b.text));
8953
- }
8954
- } else if (userProfile.role === "INDIVIDUAL") {
8955
- const individualCoterieTypeOptionList = [];
8956
- const coterieTypeOptionList = retrieveCoterieTypeOptionList();
8957
- userProfile.coterieTypeList.forEach((coterieType) => {
8958
- const foundCoterieTypeOption = coterieTypeOptionList.find(
8959
- (coterieTypeOption) => coterieTypeOption.value === coterieType
8938
+ } else {
8939
+ return retrieveCoterieTypeOptionList().sort(
8940
+ (a, b) => a.text.localeCompare(b.text)
8960
8941
  );
8961
- if (foundCoterieTypeOption) {
8962
- individualCoterieTypeOptionList.push(foundCoterieTypeOption);
8963
- }
8964
- });
8965
- return individualCoterieTypeOptionList;
8942
+ }
8943
+ } else {
8944
+ return retrieveCoterieTypeOptionList().filter((coterieTypeOption) => coterieTypeOption.value === coterieType).sort((a, b) => a.text.localeCompare(b.text));
8966
8945
  }
8967
- return [];
8968
8946
  };
8969
8947
  var filterCoterieTypeByDistinctOptionList = (distinctCoterieTypeOptionList) => {
8970
8948
  const coterieTypeOptionList = retrieveCoterieTypeOptionList();
package/dist/index.mjs CHANGED
@@ -8704,42 +8704,20 @@ var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
8704
8704
  }
8705
8705
  return retrieveGradeLevelOptionList();
8706
8706
  };
8707
- var filterCoterieTypeOptionList = (userInformation, userProfile, userProfileInstitution) => {
8708
- if (userInformation.accountType === "GENIXO") {
8709
- return retrieveCoterieTypeOptionList().sort(
8710
- (a, b) => a.text.localeCompare(b.text)
8711
- );
8712
- }
8713
- if (userProfile.role === "STAFF" || userProfile.role === "CONTENT_CREATOR") {
8714
- if (userProfile.coterieType === "MANAGEMENT") {
8715
- if (userProfileInstitution) {
8716
- return retrieveCoterieTypeOptionList().filter(
8717
- (coterieTypeOption) => coterieTypeOption.includes.includes(userProfileInstitution.type)
8718
- ).sort((a, b) => a.text.localeCompare(b.text));
8719
- } else {
8720
- return retrieveCoterieTypeOptionList().sort(
8721
- (a, b) => a.text.localeCompare(b.text)
8722
- );
8723
- }
8724
- } else {
8707
+ var filterCoterieTypeOptionList = (coterieType, institutionType) => {
8708
+ if (coterieType === "MANAGEMENT") {
8709
+ if (institutionType) {
8725
8710
  return retrieveCoterieTypeOptionList().filter(
8726
- (coterieTypeOption) => coterieTypeOption.value === userProfile.coterieType
8711
+ (coterieTypeOption) => coterieTypeOption.includes.includes(institutionType)
8727
8712
  ).sort((a, b) => a.text.localeCompare(b.text));
8728
- }
8729
- } else if (userProfile.role === "INDIVIDUAL") {
8730
- const individualCoterieTypeOptionList = [];
8731
- const coterieTypeOptionList = retrieveCoterieTypeOptionList();
8732
- userProfile.coterieTypeList.forEach((coterieType) => {
8733
- const foundCoterieTypeOption = coterieTypeOptionList.find(
8734
- (coterieTypeOption) => coterieTypeOption.value === coterieType
8713
+ } else {
8714
+ return retrieveCoterieTypeOptionList().sort(
8715
+ (a, b) => a.text.localeCompare(b.text)
8735
8716
  );
8736
- if (foundCoterieTypeOption) {
8737
- individualCoterieTypeOptionList.push(foundCoterieTypeOption);
8738
- }
8739
- });
8740
- return individualCoterieTypeOptionList;
8717
+ }
8718
+ } else {
8719
+ return retrieveCoterieTypeOptionList().filter((coterieTypeOption) => coterieTypeOption.value === coterieType).sort((a, b) => a.text.localeCompare(b.text));
8741
8720
  }
8742
- return [];
8743
8721
  };
8744
8722
  var filterCoterieTypeByDistinctOptionList = (distinctCoterieTypeOptionList) => {
8745
8723
  const coterieTypeOptionList = retrieveCoterieTypeOptionList();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.26",
3
+ "version": "2.2.27",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1192,50 +1192,26 @@ export const filterGradeLevelOptionList = (
1192
1192
  };
1193
1193
 
1194
1194
  export const filterCoterieTypeOptionList = (
1195
- userInformation: any,
1196
- userProfile: any,
1197
- userProfileInstitution: any
1195
+ coterieType: any,
1196
+ institutionType: any
1198
1197
  ) => {
1199
- if (userInformation.accountType === "GENIXO") {
1200
- return retrieveCoterieTypeOptionList().sort((a, b) =>
1201
- a.text.localeCompare(b.text)
1202
- );
1203
- }
1204
- if (userProfile.role === "STAFF" || userProfile.role === "CONTENT_CREATOR") {
1205
- if (userProfile.coterieType === "MANAGEMENT") {
1206
- if (userProfileInstitution) {
1207
- return retrieveCoterieTypeOptionList()
1208
- .filter((coterieTypeOption) =>
1209
- coterieTypeOption.includes.includes(userProfileInstitution.type)
1210
- )
1211
- .sort((a, b) => a.text.localeCompare(b.text));
1212
- } else {
1213
- return retrieveCoterieTypeOptionList().sort((a, b) =>
1214
- a.text.localeCompare(b.text)
1215
- );
1216
- }
1217
- } else {
1198
+ if (coterieType === "MANAGEMENT") {
1199
+ if (institutionType) {
1218
1200
  return retrieveCoterieTypeOptionList()
1219
- .filter(
1220
- (coterieTypeOption) =>
1221
- coterieTypeOption.value === userProfile.coterieType
1201
+ .filter((coterieTypeOption) =>
1202
+ coterieTypeOption.includes.includes(institutionType)
1222
1203
  )
1223
1204
  .sort((a, b) => a.text.localeCompare(b.text));
1224
- }
1225
- } else if (userProfile.role === "INDIVIDUAL") {
1226
- const individualCoterieTypeOptionList: any = [];
1227
- const coterieTypeOptionList = retrieveCoterieTypeOptionList();
1228
- userProfile.coterieTypeList.forEach((coterieType: any) => {
1229
- const foundCoterieTypeOption = coterieTypeOptionList.find(
1230
- (coterieTypeOption) => coterieTypeOption.value === coterieType
1205
+ } else {
1206
+ return retrieveCoterieTypeOptionList().sort((a, b) =>
1207
+ a.text.localeCompare(b.text)
1231
1208
  );
1232
- if (foundCoterieTypeOption) {
1233
- individualCoterieTypeOptionList.push(foundCoterieTypeOption);
1234
- }
1235
- });
1236
- return individualCoterieTypeOptionList;
1209
+ }
1210
+ } else {
1211
+ return retrieveCoterieTypeOptionList()
1212
+ .filter((coterieTypeOption) => coterieTypeOption.value === coterieType)
1213
+ .sort((a, b) => a.text.localeCompare(b.text));
1237
1214
  }
1238
- return [];
1239
1215
  };
1240
1216
 
1241
1217
  export const filterCoterieTypeByDistinctOptionList = (