next slice

This commit is contained in:
2026-03-15 09:22:39 -05:00
parent 18e4044124
commit ce21ad4a4c
13 changed files with 708 additions and 24 deletions

View File

@@ -521,6 +521,45 @@ export const api = {
return response.blob();
},
async getQuotePdf(token: string, quoteId: string) {
const response = await fetch(`/api/v1/documents/sales/quotes/${quoteId}/document.pdf`, {
headers: {
Authorization: `Bearer ${token}`,
},
});
if (!response.ok) {
throw new ApiError("Unable to render quote PDF.", "QUOTE_PDF_FAILED");
}
return response.blob();
},
async getSalesOrderPdf(token: string, orderId: string) {
const response = await fetch(`/api/v1/documents/sales/orders/${orderId}/document.pdf`, {
headers: {
Authorization: `Bearer ${token}`,
},
});
if (!response.ok) {
throw new ApiError("Unable to render sales order PDF.", "SALES_ORDER_PDF_FAILED");
}
return response.blob();
},
async getPurchaseOrderPdf(token: string, orderId: string) {
const response = await fetch(`/api/v1/documents/purchasing/orders/${orderId}/document.pdf`, {
headers: {
Authorization: `Bearer ${token}`,
},
});
if (!response.ok) {
throw new ApiError("Unable to render purchase order PDF.", "PURCHASE_ORDER_PDF_FAILED");
}
return response.blob();
},
async getCompanyProfilePreviewPdf(token: string) {
const response = await fetch("/api/v1/documents/company-profile-preview.pdf", {
headers: {