Skip to content

Commit

Permalink
hotfix: return empty arrays rather than null (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasG04 authored Mar 22, 2022
1 parent 083b703 commit e2db62c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/api/getAllUsersTicketInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default withAuthRequired(withSentry(async (req: NextApiRequest, res: Next

if (rpcError) return res.status(500).send(rpcError.message);

return res.status(200).json(data);
return res.status(200).json(data ?? []);
}));

export const config = {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/api/getTicketlessUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ export default withAuthRequired(withSentry(async (req: NextApiRequest, res: Next

const { data, error: rpcError } = await serverSupabase.rpc<ShortUser>('ticketless');

console.log(data);

if (rpcError) return res.status(500).send(rpcError.message);

return res.status(200).json(data);
return res.status(200).json(data ?? []);
}));

export const config = {
Expand Down

1 comment on commit e2db62c

@vercel
Copy link

@vercel vercel bot commented on e2db62c Mar 22, 2022

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.