diff --git a/src/server/routes/programManagement.integration-test.js b/src/server/routes/programManagement.integration-test.js index 5001882..6fc7153 100644 --- a/src/server/routes/programManagement.integration-test.js +++ b/src/server/routes/programManagement.integration-test.js @@ -105,7 +105,7 @@ describe('program-managements router', () => { describe('GET /api/program-managements', () => { it('should return 200', async () => { const response = await request - .get('/api/program-managements') + .get('/api/program-managements?limitToEditorsPrograms=true') .set({ uid: user1.id, hygroupcn: 'hy-employees' }) expect(response.status).toEqual(200) expect(response.body).toMatchObject([]) @@ -293,7 +293,7 @@ describe('program-managements router', () => { describe('GET /api/program-managements', () => { it('should return 200 and only the programs that teacher is managing', async () => { const response = await request - .get('/api/program-managements') + .get('/api/program-managements?limitToEditorsPrograms=true') .set({ uid: user1.id, hygroupcn: 'hy-employees' }) expect(response.status).toEqual(200) expect(response.body).toIncludeSameMembers([ diff --git a/src/server/routes/thesisHelpers.ts b/src/server/routes/thesisHelpers.ts index 76a6d68..82af733 100644 --- a/src/server/routes/thesisHelpers.ts +++ b/src/server/routes/thesisHelpers.ts @@ -348,7 +348,7 @@ export const handleThesisCreationEmail = async ( newThesis: ThesisData, actionUser: UserType ) => { - if (newThesis.approvers.length) { + if (newThesis.approvers?.length) { const approverTargets = newThesis.approvers .filter((approver) => approver.email) .map((approver) => approver.email)