From 7fc5092ca2898fb8f8d9fd93f11b4e11e7b1ee53 Mon Sep 17 00:00:00 2001 From: Ryota Murakami Date: Tue, 28 Nov 2023 19:32:07 +0900 Subject: [PATCH] Update CustomersTable type definition (#466) * Update CustomersTable type definition * Update import statement in CustomersTable component * Update definition everywhere --------- Co-authored-by: Delba de Oliveira Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> --- dashboard/final-example/app/lib/data.ts | 4 ++-- dashboard/final-example/app/lib/definitions.ts | 2 +- dashboard/final-example/app/ui/customers/table.tsx | 5 ++++- dashboard/starter-example/app/lib/data.ts | 4 ++-- dashboard/starter-example/app/lib/definitions.ts | 2 +- dashboard/starter-example/app/ui/customers/table.tsx | 5 ++++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dashboard/final-example/app/lib/data.ts b/dashboard/final-example/app/lib/data.ts index bbfe8d5..9fb3519 100644 --- a/dashboard/final-example/app/lib/data.ts +++ b/dashboard/final-example/app/lib/data.ts @@ -1,7 +1,7 @@ import { sql } from '@vercel/postgres'; import { CustomerField, - CustomersTable, + CustomersTableType, InvoiceForm, InvoicesTable, LatestInvoiceRaw, @@ -196,7 +196,7 @@ export async function fetchCustomers() { export async function fetchFilteredCustomers(query: string) { noStore(); try { - const data = await sql` + const data = await sql` SELECT customers.id, customers.name, diff --git a/dashboard/final-example/app/lib/definitions.ts b/dashboard/final-example/app/lib/definitions.ts index 610eb54..b1a4fbf 100644 --- a/dashboard/final-example/app/lib/definitions.ts +++ b/dashboard/final-example/app/lib/definitions.ts @@ -55,7 +55,7 @@ export type InvoicesTable = { status: 'pending' | 'paid'; }; -export type CustomersTable = { +export type CustomersTableType = { id: string; name: string; email: string; diff --git a/dashboard/final-example/app/ui/customers/table.tsx b/dashboard/final-example/app/ui/customers/table.tsx index 7ca6b36..fce2f55 100644 --- a/dashboard/final-example/app/ui/customers/table.tsx +++ b/dashboard/final-example/app/ui/customers/table.tsx @@ -1,7 +1,10 @@ import Image from 'next/image'; import { lusitana } from '@/app/ui/fonts'; import Search from '@/app/ui/search'; -import { CustomersTable, FormattedCustomersTable } from '@/app/lib/definitions'; +import { + CustomersTableType, + FormattedCustomersTable, +} from '@/app/lib/definitions'; export default async function CustomersTable({ customers, diff --git a/dashboard/starter-example/app/lib/data.ts b/dashboard/starter-example/app/lib/data.ts index 01516d6..4c699a3 100644 --- a/dashboard/starter-example/app/lib/data.ts +++ b/dashboard/starter-example/app/lib/data.ts @@ -1,7 +1,7 @@ import { sql } from '@vercel/postgres'; import { CustomerField, - CustomersTable, + CustomersTableType, InvoiceForm, InvoicesTable, LatestInvoiceRaw, @@ -189,7 +189,7 @@ export async function fetchCustomers() { export async function fetchFilteredCustomers(query: string) { try { - const data = await sql` + const data = await sql` SELECT customers.id, customers.name, diff --git a/dashboard/starter-example/app/lib/definitions.ts b/dashboard/starter-example/app/lib/definitions.ts index 610eb54..b1a4fbf 100644 --- a/dashboard/starter-example/app/lib/definitions.ts +++ b/dashboard/starter-example/app/lib/definitions.ts @@ -55,7 +55,7 @@ export type InvoicesTable = { status: 'pending' | 'paid'; }; -export type CustomersTable = { +export type CustomersTableType = { id: string; name: string; email: string; diff --git a/dashboard/starter-example/app/ui/customers/table.tsx b/dashboard/starter-example/app/ui/customers/table.tsx index 7ca6b36..fce2f55 100644 --- a/dashboard/starter-example/app/ui/customers/table.tsx +++ b/dashboard/starter-example/app/ui/customers/table.tsx @@ -1,7 +1,10 @@ import Image from 'next/image'; import { lusitana } from '@/app/ui/fonts'; import Search from '@/app/ui/search'; -import { CustomersTable, FormattedCustomersTable } from '@/app/lib/definitions'; +import { + CustomersTableType, + FormattedCustomersTable, +} from '@/app/lib/definitions'; export default async function CustomersTable({ customers,