From 9daf946b78a3cc2e4892cec00e51cee60bc90e54 Mon Sep 17 00:00:00 2001 From: wnhlee <40269597+2wheeh@users.noreply.github.com> Date: Mon, 24 Jun 2024 08:01:57 +0900 Subject: [PATCH] Remove unused getUser (#533) * remove unused getUser * fixup --- dashboard/final-example/app/lib/data.ts | 11 ----------- dashboard/starter-example/app/lib/data.ts | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/dashboard/final-example/app/lib/data.ts b/dashboard/final-example/app/lib/data.ts index 5ca645b..c61293d 100644 --- a/dashboard/final-example/app/lib/data.ts +++ b/dashboard/final-example/app/lib/data.ts @@ -5,7 +5,6 @@ import { InvoiceForm, InvoicesTable, LatestInvoiceRaw, - User, Revenue, } from './definitions'; import { formatCurrency } from './utils'; @@ -226,13 +225,3 @@ export async function fetchFilteredCustomers(query: string) { throw new Error('Failed to fetch customer table.'); } } - -export async function getUser(email: string) { - try { - const user = await sql`SELECT * FROM users WHERE email=${email}`; - return user.rows[0] as User; - } catch (error) { - console.error('Failed to fetch user:', error); - throw new Error('Failed to fetch user.'); - } -} diff --git a/dashboard/starter-example/app/lib/data.ts b/dashboard/starter-example/app/lib/data.ts index 3e32426..141f2a8 100644 --- a/dashboard/starter-example/app/lib/data.ts +++ b/dashboard/starter-example/app/lib/data.ts @@ -5,7 +5,6 @@ import { InvoiceForm, InvoicesTable, LatestInvoiceRaw, - User, Revenue, } from './definitions'; import { formatCurrency } from './utils'; @@ -219,13 +218,3 @@ export async function fetchFilteredCustomers(query: string) { throw new Error('Failed to fetch customer table.'); } } - -export async function getUser(email: string) { - try { - const user = await sql`SELECT * FROM users WHERE email=${email}`; - return user.rows[0] as User; - } catch (error) { - console.error('Failed to fetch user:', error); - throw new Error('Failed to fetch user.'); - } -}