mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
26 lines
605 B
TypeScript
26 lines
605 B
TypeScript
import { get, handleError } from '@/data/fetchers'
|
|
|
|
export type InvoiceReceiptVariables = {
|
|
invoiceId: string
|
|
slug: string
|
|
}
|
|
|
|
export async function getInvoiceReceipt(
|
|
{ invoiceId, slug }: InvoiceReceiptVariables,
|
|
signal?: AbortSignal
|
|
) {
|
|
if (!invoiceId) throw new Error('Invoice ID is required')
|
|
if (!slug) throw new Error('Slug is required')
|
|
|
|
const { data, error } = await get(
|
|
`/platform/organizations/{slug}/billing/invoices/{invoice_id}/receipt`,
|
|
{
|
|
params: { path: { invoice_id: invoiceId, slug } },
|
|
signal,
|
|
}
|
|
)
|
|
|
|
if (error) handleError(error)
|
|
return data
|
|
}
|