mirror of
https://github.com/vercel/next-learn.git
synced 2026-06-11 09:51:47 +00:00
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user