catchup-library-web 2.2.22 → 2.2.23

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.
@@ -168,82 +168,97 @@ export const retrieveCampusDTOByUserProfileOptionList = (
168
168
  const campusDTOOptionList = [];
169
169
  if (userProfile) {
170
170
  if (selectedBrandId) {
171
- for (const branchDTO of userProfile.branchDTOList) {
172
- const currentCampus =
173
- branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO;
174
- if (
175
- campusDTOOptionList.findIndex(
176
- (campusDTOOption) => campusDTOOption.value === currentCampus.id
177
- ) === -1 &&
178
- currentCampus.brandDTO.id === parseFloat(selectedBrandId)
179
- ) {
180
- campusDTOOptionList.push({
181
- value: currentCampus.id,
182
- fullValue: currentCampus,
183
- text: currentCampus.name,
184
- });
171
+ if (userProfile.branchDTOList) {
172
+ for (const branchDTO of userProfile.branchDTOList) {
173
+ const currentCampus =
174
+ branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO;
175
+ if (
176
+ campusDTOOptionList.findIndex(
177
+ (campusDTOOption) => campusDTOOption.value === currentCampus.id
178
+ ) === -1 &&
179
+ currentCampus.brandDTO.id === parseFloat(selectedBrandId)
180
+ ) {
181
+ campusDTOOptionList.push({
182
+ value: currentCampus.id,
183
+ fullValue: currentCampus,
184
+ text: currentCampus.name,
185
+ });
186
+ }
185
187
  }
186
188
  }
187
- for (const gradeDTO of userProfile.gradeDTOList) {
188
- const currentCampus = gradeDTO.seasonDTO.institutionDTO.campusDTO;
189
- if (
190
- campusDTOOptionList.findIndex(
191
- (campusDTOOption) => campusDTOOption.value === currentCampus.id
192
- ) === -1 &&
193
- currentCampus.brandDTO.id === parseFloat(selectedBrandId)
194
- ) {
195
- campusDTOOptionList.push({
196
- value: currentCampus.id,
197
- fullValue: currentCampus,
198
- text: currentCampus.name,
199
- });
189
+
190
+ if (userProfile.gradeDTOList) {
191
+ for (const gradeDTO of userProfile.gradeDTOList) {
192
+ const currentCampus = gradeDTO.seasonDTO.institutionDTO.campusDTO;
193
+ if (
194
+ campusDTOOptionList.findIndex(
195
+ (campusDTOOption) => campusDTOOption.value === currentCampus.id
196
+ ) === -1 &&
197
+ currentCampus.brandDTO.id === parseFloat(selectedBrandId)
198
+ ) {
199
+ campusDTOOptionList.push({
200
+ value: currentCampus.id,
201
+ fullValue: currentCampus,
202
+ text: currentCampus.name,
203
+ });
204
+ }
200
205
  }
201
206
  }
202
- for (const seasonDTO of userProfile.seasonDTOList) {
203
- const currentCampus = seasonDTO.institutionDTO.campusDTO;
204
- if (
205
- campusDTOOptionList.findIndex(
206
- (campusDTOOption) => campusDTOOption.value === currentCampus.id
207
- ) === -1 &&
208
- currentCampus.brandDTO.id === parseFloat(selectedBrandId)
209
- ) {
210
- campusDTOOptionList.push({
211
- value: currentCampus.id,
212
- fullValue: currentCampus,
213
- text: currentCampus.name,
214
- });
207
+
208
+ if (userProfile.seasonDTOList) {
209
+ for (const seasonDTO of userProfile.seasonDTOList) {
210
+ const currentCampus = seasonDTO.institutionDTO.campusDTO;
211
+ if (
212
+ campusDTOOptionList.findIndex(
213
+ (campusDTOOption) => campusDTOOption.value === currentCampus.id
214
+ ) === -1 &&
215
+ currentCampus.brandDTO.id === parseFloat(selectedBrandId)
216
+ ) {
217
+ campusDTOOptionList.push({
218
+ value: currentCampus.id,
219
+ fullValue: currentCampus,
220
+ text: currentCampus.name,
221
+ });
222
+ }
215
223
  }
216
224
  }
217
- for (const institutionDTO of userProfile.institutionDTOList) {
218
- const currentCampus = institutionDTO.campusDTO;
219
- if (
220
- campusDTOOptionList.findIndex(
221
- (campusDTOOption) => campusDTOOption.value === currentCampus.id
222
- ) === -1 &&
223
- currentCampus.brandDTO.id === parseFloat(selectedBrandId)
224
- ) {
225
- campusDTOOptionList.push({
226
- value: currentCampus.id,
227
- fullValue: currentCampus,
228
- text: currentCampus.name,
229
- });
225
+
226
+ if (userProfile.institutionDTOList) {
227
+ for (const institutionDTO of userProfile.institutionDTOList) {
228
+ const currentCampus = institutionDTO.campusDTO;
229
+ if (
230
+ campusDTOOptionList.findIndex(
231
+ (campusDTOOption) => campusDTOOption.value === currentCampus.id
232
+ ) === -1 &&
233
+ currentCampus.brandDTO.id === parseFloat(selectedBrandId)
234
+ ) {
235
+ campusDTOOptionList.push({
236
+ value: currentCampus.id,
237
+ fullValue: currentCampus,
238
+ text: currentCampus.name,
239
+ });
240
+ }
230
241
  }
231
242
  }
232
- for (const campusDTO of userProfile.campusDTOList) {
233
- const currentCampus = campusDTO;
234
- if (
235
- campusDTOOptionList.findIndex(
236
- (campusDTOOption) => campusDTOOption.value === currentCampus.id
237
- ) === -1 &&
238
- currentCampus.brandDTO.id === parseFloat(selectedBrandId)
239
- ) {
240
- campusDTOOptionList.push({
241
- value: currentCampus.id,
242
- fullValue: currentCampus,
243
- text: currentCampus.name,
244
- });
243
+
244
+ if (userProfile.campusDTOList) {
245
+ for (const campusDTO of userProfile.campusDTOList) {
246
+ const currentCampus = campusDTO;
247
+ if (
248
+ campusDTOOptionList.findIndex(
249
+ (campusDTOOption) => campusDTOOption.value === currentCampus.id
250
+ ) === -1 &&
251
+ currentCampus.brandDTO.id === parseFloat(selectedBrandId)
252
+ ) {
253
+ campusDTOOptionList.push({
254
+ value: currentCampus.id,
255
+ fullValue: currentCampus,
256
+ text: currentCampus.name,
257
+ });
258
+ }
245
259
  }
246
260
  }
261
+
247
262
  return campusDTOOptionList;
248
263
  }
249
264
  }
@@ -259,76 +274,88 @@ export const retrieveInstitutionDTOByUserProfileOptionList = (
259
274
  const institutionDTOOptionList = [];
260
275
  if (userProfile) {
261
276
  if (selectedCampusId) {
262
- for (const branchDTO of userProfile.branchDTOList) {
263
- const currentInstitution = branchDTO.gradeDTO.seasonDTO.institutionDTO;
264
- if (
265
- institutionDTOOptionList.findIndex(
266
- (institutionDTOOption) =>
267
- institutionDTOOption.value === currentInstitution.id
268
- ) === -1 &&
269
- currentInstitution.campusDTO.brandDTO.id ===
270
- parseFloat(selectedBrandId) &&
271
- currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
272
- ) {
273
- institutionDTOOptionList.push({
274
- value: currentInstitution.id,
275
- fullValue: currentInstitution,
276
- text: currentInstitution.name,
277
- });
277
+ if (userProfile.branchDTOList) {
278
+ for (const branchDTO of userProfile.branchDTOList) {
279
+ const currentInstitution =
280
+ branchDTO.gradeDTO.seasonDTO.institutionDTO;
281
+ if (
282
+ institutionDTOOptionList.findIndex(
283
+ (institutionDTOOption) =>
284
+ institutionDTOOption.value === currentInstitution.id
285
+ ) === -1 &&
286
+ currentInstitution.campusDTO.brandDTO.id ===
287
+ parseFloat(selectedBrandId) &&
288
+ currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
289
+ ) {
290
+ institutionDTOOptionList.push({
291
+ value: currentInstitution.id,
292
+ fullValue: currentInstitution,
293
+ text: currentInstitution.name,
294
+ });
295
+ }
278
296
  }
279
297
  }
280
- for (const gradeDTO of userProfile.gradeDTOList) {
281
- const currentInstitution = gradeDTO.seasonDTO.institutionDTO;
282
- if (
283
- institutionDTOOptionList.findIndex(
284
- (institutionDTOOption) =>
285
- institutionDTOOption.value === currentInstitution.id
286
- ) === -1 &&
287
- currentInstitution.campusDTO.brandDTO.id ===
288
- parseFloat(selectedBrandId) &&
289
- currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
290
- ) {
291
- institutionDTOOptionList.push({
292
- value: currentInstitution.id,
293
- fullValue: currentInstitution,
294
- text: currentInstitution.name,
295
- });
298
+
299
+ if (userProfile.gradeDTOList) {
300
+ for (const gradeDTO of userProfile.gradeDTOList) {
301
+ const currentInstitution = gradeDTO.seasonDTO.institutionDTO;
302
+ if (
303
+ institutionDTOOptionList.findIndex(
304
+ (institutionDTOOption) =>
305
+ institutionDTOOption.value === currentInstitution.id
306
+ ) === -1 &&
307
+ currentInstitution.campusDTO.brandDTO.id ===
308
+ parseFloat(selectedBrandId) &&
309
+ currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
310
+ ) {
311
+ institutionDTOOptionList.push({
312
+ value: currentInstitution.id,
313
+ fullValue: currentInstitution,
314
+ text: currentInstitution.name,
315
+ });
316
+ }
296
317
  }
297
318
  }
298
- for (const seasonDTO of userProfile.seasonDTOList) {
299
- const currentInstitution = seasonDTO.institutionDTO;
300
- if (
301
- institutionDTOOptionList.findIndex(
302
- (institutionDTOOption) =>
303
- institutionDTOOption.value === currentInstitution.id
304
- ) === -1 &&
305
- currentInstitution.campusDTO.brandDTO.id ===
306
- parseFloat(selectedBrandId) &&
307
- currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
308
- ) {
309
- institutionDTOOptionList.push({
310
- value: currentInstitution.id,
311
- fullValue: currentInstitution,
312
- text: currentInstitution.name,
313
- });
319
+
320
+ if (userProfile.seasonDTOList) {
321
+ for (const seasonDTO of userProfile.seasonDTOList) {
322
+ const currentInstitution = seasonDTO.institutionDTO;
323
+ if (
324
+ institutionDTOOptionList.findIndex(
325
+ (institutionDTOOption) =>
326
+ institutionDTOOption.value === currentInstitution.id
327
+ ) === -1 &&
328
+ currentInstitution.campusDTO.brandDTO.id ===
329
+ parseFloat(selectedBrandId) &&
330
+ currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
331
+ ) {
332
+ institutionDTOOptionList.push({
333
+ value: currentInstitution.id,
334
+ fullValue: currentInstitution,
335
+ text: currentInstitution.name,
336
+ });
337
+ }
314
338
  }
315
339
  }
316
- for (const institutionDTO of userProfile.institutionDTOList) {
317
- const currentInstitution = institutionDTO;
318
- if (
319
- institutionDTOOptionList.findIndex(
320
- (institutionDTOOption) =>
321
- institutionDTOOption.value === currentInstitution.id
322
- ) === -1 &&
323
- currentInstitution.campusDTO.brandDTO.id ===
324
- parseFloat(selectedBrandId) &&
325
- currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
326
- ) {
327
- institutionDTOOptionList.push({
328
- value: currentInstitution.id,
329
- fullValue: currentInstitution,
330
- text: currentInstitution.name,
331
- });
340
+
341
+ if (userProfile.institutionDTOList) {
342
+ for (const institutionDTO of userProfile.institutionDTOList) {
343
+ const currentInstitution = institutionDTO;
344
+ if (
345
+ institutionDTOOptionList.findIndex(
346
+ (institutionDTOOption) =>
347
+ institutionDTOOption.value === currentInstitution.id
348
+ ) === -1 &&
349
+ currentInstitution.campusDTO.brandDTO.id ===
350
+ parseFloat(selectedBrandId) &&
351
+ currentInstitution.campusDTO.id === parseFloat(selectedCampusId)
352
+ ) {
353
+ institutionDTOOptionList.push({
354
+ value: currentInstitution.id,
355
+ fullValue: currentInstitution,
356
+ text: currentInstitution.name,
357
+ });
358
+ }
332
359
  }
333
360
  }
334
361
  }
@@ -344,55 +371,66 @@ export const retrieveSeasonDTOByUserProfileOptionList = (
344
371
  const seasonDTOOptionList = [];
345
372
  if (userProfile) {
346
373
  if (selectedInstitutionId) {
347
- for (const branchDTO of userProfile.branchDTOList) {
348
- const currentSeason = branchDTO.gradeDTO.seasonDTO;
349
- if (
350
- seasonDTOOptionList.findIndex(
351
- (seasonDTOOption) => seasonDTOOption.value === currentSeason.id
352
- ) === -1 &&
353
- currentSeason.institutionDTO.campusDTO.brandDTO.id ===
354
- parseFloat(selectedBrandId) &&
355
- currentSeason.institutionDTO.id === parseFloat(selectedInstitutionId)
356
- ) {
357
- seasonDTOOptionList.push({
358
- value: currentSeason.id,
359
- fullValue: currentSeason,
360
- text: currentSeason.name,
361
- });
374
+ if (userProfile.branchDTOList) {
375
+ for (const branchDTO of userProfile.branchDTOList) {
376
+ const currentSeason = branchDTO.gradeDTO.seasonDTO;
377
+ if (
378
+ seasonDTOOptionList.findIndex(
379
+ (seasonDTOOption) => seasonDTOOption.value === currentSeason.id
380
+ ) === -1 &&
381
+ currentSeason.institutionDTO.campusDTO.brandDTO.id ===
382
+ parseFloat(selectedBrandId) &&
383
+ currentSeason.institutionDTO.id ===
384
+ parseFloat(selectedInstitutionId)
385
+ ) {
386
+ seasonDTOOptionList.push({
387
+ value: currentSeason.id,
388
+ fullValue: currentSeason,
389
+ text: currentSeason.name,
390
+ });
391
+ }
362
392
  }
363
393
  }
364
- for (const gradeDTO of userProfile.gradeDTOList) {
365
- const currentSeason = gradeDTO.seasonDTO;
366
- if (
367
- seasonDTOOptionList.findIndex(
368
- (seasonDTOOption) => seasonDTOOption.value === currentSeason.id
369
- ) === -1 &&
370
- currentSeason.institutionDTO.campusDTO.brandDTO.id ===
371
- parseFloat(selectedBrandId) &&
372
- currentSeason.institutionDTO.id === parseFloat(selectedInstitutionId)
373
- ) {
374
- seasonDTOOptionList.push({
375
- value: currentSeason.id,
376
- fullValue: currentSeason,
377
- text: currentSeason.name,
378
- });
394
+
395
+ if (userProfile.gradeDTOList) {
396
+ for (const gradeDTO of userProfile.gradeDTOList) {
397
+ const currentSeason = gradeDTO.seasonDTO;
398
+ if (
399
+ seasonDTOOptionList.findIndex(
400
+ (seasonDTOOption) => seasonDTOOption.value === currentSeason.id
401
+ ) === -1 &&
402
+ currentSeason.institutionDTO.campusDTO.brandDTO.id ===
403
+ parseFloat(selectedBrandId) &&
404
+ currentSeason.institutionDTO.id ===
405
+ parseFloat(selectedInstitutionId)
406
+ ) {
407
+ seasonDTOOptionList.push({
408
+ value: currentSeason.id,
409
+ fullValue: currentSeason,
410
+ text: currentSeason.name,
411
+ });
412
+ }
379
413
  }
380
414
  }
381
- for (const seasonDTO of userProfile.seasonDTOList) {
382
- const currentSeason = seasonDTO;
383
- if (
384
- seasonDTOOptionList.findIndex(
385
- (seasonDTOOption) => seasonDTOOption.value === currentSeason.id
386
- ) === -1 &&
387
- currentSeason.institutionDTO.campusDTO.brandDTO.id ===
388
- parseFloat(selectedBrandId) &&
389
- currentSeason.institutionDTO.id === parseFloat(selectedInstitutionId)
390
- ) {
391
- seasonDTOOptionList.push({
392
- value: currentSeason.id,
393
- fullValue: currentSeason,
394
- text: currentSeason.name,
395
- });
415
+
416
+ if (userProfile.seasonDTOList) {
417
+ for (const seasonDTO of userProfile.seasonDTOList) {
418
+ const currentSeason = seasonDTO;
419
+ if (
420
+ seasonDTOOptionList.findIndex(
421
+ (seasonDTOOption) => seasonDTOOption.value === currentSeason.id
422
+ ) === -1 &&
423
+ currentSeason.institutionDTO.campusDTO.brandDTO.id ===
424
+ parseFloat(selectedBrandId) &&
425
+ currentSeason.institutionDTO.id ===
426
+ parseFloat(selectedInstitutionId)
427
+ ) {
428
+ seasonDTOOptionList.push({
429
+ value: currentSeason.id,
430
+ fullValue: currentSeason,
431
+ text: currentSeason.name,
432
+ });
433
+ }
396
434
  }
397
435
  }
398
436
  }
@@ -408,38 +446,43 @@ export const retrieveGradeDTOByUserProfileOptionList = (
408
446
  const gradeDTOOptionList = [];
409
447
  if (userProfile) {
410
448
  if (selectedSeasonId) {
411
- for (const branchDTO of userProfile.branchDTOList) {
412
- const currentGrade = branchDTO.gradeDTO;
413
- if (
414
- gradeDTOOptionList.findIndex(
415
- (gradeDTOOption) => gradeDTOOption.value === currentGrade.id
416
- ) === -1 &&
417
- currentGrade.seasonDTO.institutionDTO.campusDTO.brandDTO.id ===
418
- parseFloat(selectedBrandId) &&
419
- currentGrade.seasonDTO.id === parseFloat(selectedSeasonId)
420
- ) {
421
- gradeDTOOptionList.push({
422
- value: currentGrade.id,
423
- fullValue: currentGrade,
424
- text: currentGrade.name,
425
- });
449
+ if (userProfile.branchDTOList) {
450
+ for (const branchDTO of userProfile.branchDTOList) {
451
+ const currentGrade = branchDTO.gradeDTO;
452
+ if (
453
+ gradeDTOOptionList.findIndex(
454
+ (gradeDTOOption) => gradeDTOOption.value === currentGrade.id
455
+ ) === -1 &&
456
+ currentGrade.seasonDTO.institutionDTO.campusDTO.brandDTO.id ===
457
+ parseFloat(selectedBrandId) &&
458
+ currentGrade.seasonDTO.id === parseFloat(selectedSeasonId)
459
+ ) {
460
+ gradeDTOOptionList.push({
461
+ value: currentGrade.id,
462
+ fullValue: currentGrade,
463
+ text: currentGrade.name,
464
+ });
465
+ }
426
466
  }
427
467
  }
428
- for (const gradeDTO of userProfile.gradeDTOList) {
429
- const currentGrade = gradeDTO;
430
- if (
431
- gradeDTOOptionList.findIndex(
432
- (gradeDTOOption) => gradeDTOOption.value === currentGrade.id
433
- ) === -1 &&
434
- currentGrade.seasonDTO.institutionDTO.campusDTO.brandDTO.id ===
435
- parseFloat(selectedBrandId) &&
436
- currentGrade.seasonDTO.id === parseFloat(selectedSeasonId)
437
- ) {
438
- gradeDTOOptionList.push({
439
- value: currentGrade.id,
440
- fullValue: currentGrade,
441
- text: currentGrade.name,
442
- });
468
+
469
+ if (userProfile.gradeDTOList) {
470
+ for (const gradeDTO of userProfile.gradeDTOList) {
471
+ const currentGrade = gradeDTO;
472
+ if (
473
+ gradeDTOOptionList.findIndex(
474
+ (gradeDTOOption) => gradeDTOOption.value === currentGrade.id
475
+ ) === -1 &&
476
+ currentGrade.seasonDTO.institutionDTO.campusDTO.brandDTO.id ===
477
+ parseFloat(selectedBrandId) &&
478
+ currentGrade.seasonDTO.id === parseFloat(selectedSeasonId)
479
+ ) {
480
+ gradeDTOOptionList.push({
481
+ value: currentGrade.id,
482
+ fullValue: currentGrade,
483
+ text: currentGrade.name,
484
+ });
485
+ }
443
486
  }
444
487
  }
445
488
  }
@@ -455,21 +498,23 @@ export const retrieveBranchDTOByUserProfileOptionList = (
455
498
  const branchDTOOptionList = [];
456
499
  if (userProfile) {
457
500
  if (selectedGradeId) {
458
- for (const branchDTO of userProfile.branchDTOList) {
459
- const currentBranch = branchDTO;
460
- if (
461
- branchDTOOptionList.findIndex(
462
- (branchDTOOption) => branchDTOOption.value === currentBranch.id
463
- ) === -1 &&
464
- currentBranch.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO
465
- .id === parseFloat(selectedBrandId) &&
466
- currentBranch.gradeDTO.id === parseFloat(selectedGradeId)
467
- ) {
468
- branchDTOOptionList.push({
469
- value: currentBranch.id,
470
- fullValue: currentBranch,
471
- text: currentBranch.name,
472
- });
501
+ if (userProfile.branchDTOList) {
502
+ for (const branchDTO of userProfile.branchDTOList) {
503
+ const currentBranch = branchDTO;
504
+ if (
505
+ branchDTOOptionList.findIndex(
506
+ (branchDTOOption) => branchDTOOption.value === currentBranch.id
507
+ ) === -1 &&
508
+ currentBranch.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO
509
+ .id === parseFloat(selectedBrandId) &&
510
+ currentBranch.gradeDTO.id === parseFloat(selectedGradeId)
511
+ ) {
512
+ branchDTOOptionList.push({
513
+ value: currentBranch.id,
514
+ fullValue: currentBranch,
515
+ text: currentBranch.name,
516
+ });
517
+ }
473
518
  }
474
519
  }
475
520
  }