diff --git a/src/data/LoadingPlanHarRepository.ts b/src/data/LoadingPlanHarRepository.ts index fdff9a3f..3d001800 100644 --- a/src/data/LoadingPlanHarRepository.ts +++ b/src/data/LoadingPlanHarRepository.ts @@ -54,7 +54,7 @@ export class LoadingPlanHarRepository implements LoadingPlanRepository { if (location && location.match(/failed/)) { throw new Error(`Login failed: ${config.data} -> location=${location}`); } - const cookie = res.headers["set-cookie"]?.[0].split(";")[0] || ""; + const cookie = res.headers["set-cookie"]?.[0]?.split(";")[0] || ""; console.debug(`Cookie from server: ${cookie}`); this.cookie = cookie; } diff --git a/src/data/enrollments/EventsD2Repository.ts b/src/data/enrollments/EventsD2Repository.ts index c267332a..7ddb708f 100644 --- a/src/data/enrollments/EventsD2Repository.ts +++ b/src/data/enrollments/EventsD2Repository.ts @@ -16,7 +16,7 @@ export class EventsD2Repository implements EventsRepository { updatedBefore: params.eventUpdateCutoff, order: "enrollment,updatedAt", fields: { - events: true, + event: true, program: true, orgUnit: true, status: true,