fix
This commit is contained in:
@@ -53,7 +53,8 @@ export async function postStickerGenerate(formData: FormData): Promise<Blob> {
|
||||
: ''
|
||||
throw new ApiHttpError(msg || `HTTP ${res.status}`, res.status, errBody)
|
||||
}
|
||||
return res.blob()
|
||||
const raw = await res.blob()
|
||||
return new Blob([await raw.arrayBuffer()], { type: 'application/pdf' })
|
||||
}
|
||||
|
||||
export async function postBadgeGenerate(formData: FormData): Promise<Blob> {
|
||||
@@ -73,7 +74,8 @@ export async function postBadgeGenerate(formData: FormData): Promise<Blob> {
|
||||
: ''
|
||||
throw new ApiHttpError(msg || `HTTP ${res.status}`, res.status, errBody)
|
||||
}
|
||||
return res.blob()
|
||||
const raw = await res.blob()
|
||||
return new Blob([await raw.arrayBuffer()], { type: 'application/pdf' })
|
||||
}
|
||||
|
||||
export type StickerPreviewCounts = {
|
||||
@@ -271,7 +273,7 @@ export async function openReportCardDownload(url: string): Promise<void> {
|
||||
if (token) headers.set('Authorization', `Bearer ${token}`)
|
||||
const res = await fetch(url, { headers })
|
||||
if (!res.ok) throw new ApiHttpError(`HTTP ${res.status}`, res.status, null)
|
||||
const blob = await res.blob()
|
||||
const r = URL.createObjectURL(blob)
|
||||
window.open(r, '_blank', 'noopener')
|
||||
const raw = await res.blob()
|
||||
const blob = new Blob([await raw.arrayBuffer()], { type: 'application/pdf' })
|
||||
window.open(URL.createObjectURL(blob), '_blank', 'noopener')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user