refactor: split up routers to separate lambdas (#8041)
* split up routers to separate lambdas * fix responsemeta * move * add typeguards to make sure all endpoints are covered in the approuter * prettier * move slotsrouter * split ssg/ssr * make sure correct headers are sent on viewer.public * make sure correct headers are sent + use ctx.prisma * Fixed new prefetch broken by merge * Fixes after merge * Created separate API route for all tRPC routers * More fixes from refactor * Fixed tRPC query for slots * Put back extra line * Fixed type checks * Removed Endpoint type check since it loads from client * Reverted change in getSchedule test * Fix trpc routes in expectations * Fix one more route test --------- Co-authored-by: Efraín Rochín <[email protected]> Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Keith Williams <[email protected]> Co-authored-by: zomars <[email protected]> Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
27 files changed
+235
-96
No files matched your search
@@ -33,7 +33,7 @@ test.describe("Availablity tests", () => {
|
||||
});
|
||||
|
||||
await test.step("Date override is displayed in troubleshooter", async () => {
|
||||
const response = await page.waitForResponse("**/api/trpc/viewer.availability.schedule.update?batch=1");
|
||||
const response = await page.waitForResponse("**/api/trpc/availability/schedule.update?batch=1");
|
||||
const json = await response.json();
|
||||
// @ts-expect-error trust me bro
|
||||
const date = json[0].result.data.json.schedule.availability.find((a) => !!a.date);
|
||||
|
||||
@@ -131,7 +131,7 @@ testBothBookers.describe("pro user", () => {
|
||||
await page.goto("/bookings/unconfirmed");
|
||||
await Promise.all([
|
||||
page.click('[data-testid="confirm"]'),
|
||||
page.waitForResponse((response) => response.url().includes("/api/trpc/viewer.bookings.confirm")),
|
||||
page.waitForResponse((response) => response.url().includes("/api/trpc/bookings/confirm")),
|
||||
]);
|
||||
// This is the only booking in there that needed confirmation and now it should be empty screen
|
||||
await expect(page.locator('[data-testid="empty-screen"]')).toBeVisible();
|
||||
|
||||
Reference in new issue
Block a user