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:
Ryota Murakami
2023-11-28 19:32:07 +09:00
committed by GitHub
parent b163626ded
commit 7fc5092ca2
6 changed files with 14 additions and 8 deletions

View File

@@ -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,

View File

@@ -55,7 +55,7 @@ export type InvoicesTable = {
status: 'pending' | 'paid';
};
export type CustomersTable = {
export type CustomersTableType = {
id: string;
name: string;
email: string;

View File

@@ -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,

View File

@@ -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,

View File

@@ -55,7 +55,7 @@ export type InvoicesTable = {
status: 'pending' | 'paid';
};
export type CustomersTable = {
export type CustomersTableType = {
id: string;
name: string;
email: string;

View File

@@ -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,