Skip to content

Commit

Permalink
fix: Proper error message for Zoom user deletion & Ignore if user doe…
Browse files Browse the repository at this point in the history
…sn't exist (#976)

* fix: Properly show message when deleting Zoom user

* fix: Ignore if Zoom user is already gone

---------

Co-authored-by: Jonas Wilms <[email protected]>
  • Loading branch information
Jonasdoubleyou and Jonas Wilms authored Feb 3, 2024
1 parent 2f41d00 commit 0dcd3ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/zoom/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ const deleteZoomUser = async (student: Pick<student, 'id' | 'zoomUserId'>): Prom
1000
);

if (!response.ok) {
throw new Error(`Zoom failed to delete user for Student(${student.id}): ${response.text()}`);
if (!response.ok && response.status !== 404) {
throw new Error(`Zoom failed to delete user for Student(${student.id}): ${await response.text()}`);
}

await prisma.student.update({ where: { id: student.id }, data: { zoomUserId: null } });
Expand Down

0 comments on commit 0dcd3ab

Please sign in to comment.