Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug in zapier when user has no bookings #14159

Merged
merged 2 commits into from Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/app-store/zapier/api/subscriptions/listBookings.ts
Expand Up @@ -15,21 +15,18 @@
return res.status(500).json({ message: "Unable to get bookings." });
}
if (bookings.length === 0) {
const userInfo = validKey

Check warning on line 18 in packages/app-store/zapier/api/subscriptions/listBookings.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app-store/zapier/api/subscriptions/listBookings.ts#L18

[@typescript-eslint/no-unused-vars] 'userInfo' is assigned a value but never used. Allowed unused vars must match /^_/u.
? validKey.userId
: authorizedAccount && !authorizedAccount.isTeam
? authorizedAccount.name
: null;
const teamInfo = validKey

Check warning on line 23 in packages/app-store/zapier/api/subscriptions/listBookings.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app-store/zapier/api/subscriptions/listBookings.ts#L23

[@typescript-eslint/no-unused-vars] 'teamInfo' is assigned a value but never used. Allowed unused vars must match /^_/u.
? validKey.teamId
: authorizedAccount && authorizedAccount.isTeam
? authorizedAccount.name
: null;

const requested = teamInfo ? `team: ${teamInfo}` : `user: ${userInfo}`;
return res.status(404).json({
message: `There are no bookings to retrieve, please create a booking first. Requested: \`${requested}\``,
});
return res.status(201).json([]);
}
res.status(201).json(bookings);
}
Expand Down