fix base_api error
This commit is contained in:
@@ -43,9 +43,9 @@ export function useCertificateModal({
|
||||
|
||||
const certificateMutation = useMutation({
|
||||
mutationFn: (payload: CertificatePayload) =>
|
||||
apiRequest('POST', links.sertifikat(document_id), payload).then(
|
||||
(res) => res.data as ArrayBuffer,
|
||||
),
|
||||
apiRequest<ArrayBuffer>('POST', links.sertifikat(document_id), payload, {
|
||||
responseType: 'arraybuffer',
|
||||
}).then((res) => res.data),
|
||||
onSuccess: (data: ArrayBuffer) => {
|
||||
if (data) {
|
||||
const blob = new Blob([data], { type: 'application/pdf' });
|
||||
@@ -54,7 +54,7 @@ export function useCertificateModal({
|
||||
a.href = objectUrl;
|
||||
a.download = `certificate-${document_id}.pdf`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
setTimeout(() => URL.revokeObjectURL(objectUrl), 1000);
|
||||
}
|
||||
setSuccess(true);
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user