Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
elie222 committed Dec 30, 2024
1 parent a8709c4 commit cae4c21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/web/utils/actions/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { withActionInstrumentation } from "@/utils/actions/middleware";
import { isActionError } from "@/utils/error";

// do not return functions to the client or we'll get an error
const isStatusOk = (status: number) => status >= 200 && status < 300;
const isStatusOk = (status?: number) => status && status >= 200 && status < 300;

export const archiveThreadAction = withActionInstrumentation(
"archiveThread",
Expand All @@ -39,7 +39,7 @@ export const archiveThreadAction = withActionInstrumentation(
labelId,
});

if (!isStatusOk(res.status)) return { error: "Failed to archive thread" };
if (!isStatusOk(res?.status)) return { error: "Failed to archive thread" };
},
);

Expand Down

1 comment on commit cae4c21

@vercel
Copy link

@vercel vercel bot commented on cae4c21 Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.