From 12d7235c2ac005f641bbe974724c4799101549a8 Mon Sep 17 00:00:00 2001 From: David Nahodyl Date: Fri, 14 Jun 2024 13:26:26 -0400 Subject: [PATCH] fixed imports in example --- playground/server/api/register-precog/index.post.ts | 5 +---- playground/server/api/registrations/index.post.ts | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/playground/server/api/register-precog/index.post.ts b/playground/server/api/register-precog/index.post.ts index 0ed3a39..5a0439c 100644 --- a/playground/server/api/register-precog/index.post.ts +++ b/playground/server/api/register-precog/index.post.ts @@ -33,12 +33,9 @@ export default definePrecognitionEventHandler(registrationSchema, async (event) email: validated.email, }; - const creatredRegistration = db.insert(registrations).values(newRegistration).returning(); - + fakeDatabase.push(newRegistration); // simulate a slow response to show the loading state o the front-end await sleep(1000); - - return creatredRegistration; }); function sleep(ms: number) { diff --git a/playground/server/api/registrations/index.post.ts b/playground/server/api/registrations/index.post.ts index 3b4b8d8..ccf7d3a 100644 --- a/playground/server/api/registrations/index.post.ts +++ b/playground/server/api/registrations/index.post.ts @@ -30,8 +30,6 @@ export default defineEventHandler(async (event) => { email: validated.email, }; - const fakeDatabase = getFakeDatabase; - fakeDatabase.push(newRegistration); // simulate a slow response to show the loading state o the front-end