fix architecture and write new tests
This commit is contained in:
@@ -467,14 +467,13 @@ export default function AdminBillingPage() {
|
||||
)
|
||||
|
||||
async function api<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const token = localStorage.getItem('admin_token')
|
||||
const res = await fetch(`${ADMIN_API_BASE}${path}`, {
|
||||
...init,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
||||
...(init?.headers ?? {}),
|
||||
},
|
||||
credentials: 'include',
|
||||
cache: 'no-store',
|
||||
})
|
||||
if (res.headers.get('content-type')?.includes('application/pdf')) {
|
||||
|
||||
Reference in New Issue
Block a user