Minimal Viable Product + Refactor to pinia store + Fix PDF export
Some checks failed
linter / quality (push) Successful in 3m37s
tests / ci (push) Failing after 13m21s

This commit is contained in:
2025-09-16 16:30:37 +02:00
parent f3ff6fd6ac
commit cb242e59ba
39 changed files with 1055 additions and 137 deletions

View File

@@ -1,13 +1,33 @@
import { jsPDF } from "jspdf";
export function exportToPdf(element: HTMLElement, name: string) {
const pdf = new jsPDF();
// const pdf = new jsPDF({orientation: 'portrait', unit: 'mm', format: 'a4', precision: 1, hotfixes: ["px_scaling"]});
// pdf.html(element, {
// callback: function (doc) {
// doc.save(name);
// },
// margin: [0, 0, 0, 0],
// autoPaging: 'text',
// // width: 210,
// // windowWidth: 2100,
// html2canvas: {
// allowTaint: true,
// letterRendering: true,
// logging: true,
// // width: 210,
// // windowWidth: 2100,
// // scale: 0.2,
// // scale: 210 / element.scrollWidth,
// },
// });
const pdf = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'a4' });
pdf.html(element, {
callback: function (doc) {
doc.save(name);
},
width: 210,
windowWidth: element.scrollWidth,
windowWidth: 1080,
});
}

View File

@@ -0,0 +1,5 @@
import { createPinia } from 'pinia'
const pinia = createPinia()
export default pinia

View File

@@ -26,9 +26,13 @@ export async function httpApi<T>(url: string, options?: RequestInit, useFetchOpt
...options,
},
useFetchOptions
).json();
);
if (!error.value && data.value) {
if (data.value) {
data.value = JSON.parse(data.value as string) as T;
}
if (!error.value) {
return { data: data.value, error: null };
} else {
return { data: data.value, error: error.value };