mirror of
https://github.com/vercel/next-learn.git
synced 2026-06-11 09:51:47 +00:00
Update CustomersTable type definition (#466)
* Update CustomersTable type definition * Update import statement in CustomersTable component * Update definition everywhere --------- Co-authored-by: Delba de Oliveira <delbabrown@gmail.com> Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
This commit is contained in:
@@ -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<CustomersTable>`
|
||||
const data = await sql<CustomersTableType>`
|
||||
SELECT
|
||||
customers.id,
|
||||
customers.name,
|
||||
|
||||
@@ -55,7 +55,7 @@ export type InvoicesTable = {
|
||||
status: 'pending' | 'paid';
|
||||
};
|
||||
|
||||
export type CustomersTable = {
|
||||
export type CustomersTableType = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<CustomersTable>`
|
||||
const data = await sql<CustomersTableType>`
|
||||
SELECT
|
||||
customers.id,
|
||||
customers.name,
|
||||
|
||||
@@ -55,7 +55,7 @@ export type InvoicesTable = {
|
||||
status: 'pending' | 'paid';
|
||||
};
|
||||
|
||||
export type CustomersTable = {
|
||||
export type CustomersTableType = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user