Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffb4de7fba |
@@ -268,6 +268,19 @@ export async function fetchFormats(): Promise<Format[]> {
|
||||
return data?.data ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Formate für den Textmengencheck: alle mit show_check=true. Das sind die
|
||||
* Text-Seiten-Formate (A4, A5, DIN lang, A6) – unabhängig davon, ob sie im
|
||||
* öffentlichen Konfigurator bestellbar sind. Adress-Postkarten sind ausgenommen.
|
||||
*/
|
||||
export async function fetchCheckFormats(): Promise<Format[]> {
|
||||
const data = await request(
|
||||
'/items/formats?fields=id,key,name,product&filter[show_check][_eq]=true&limit=-1',
|
||||
{ auth: false },
|
||||
);
|
||||
return data?.data ?? [];
|
||||
}
|
||||
|
||||
/* ── Preis & Bestellung (Extension skrift-orders) ─────────────────────────── */
|
||||
|
||||
export type QuoteLine = { label: string; amount: number; per_unit?: boolean };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { fetchFormats, fetchSettings, generatePreview } from '../lib/api';
|
||||
import { fetchCheckFormats, fetchSettings, generatePreview } from '../lib/api';
|
||||
import type { Format, PublicSettings, PreviewDoc, PreviewOverflow } from '../lib/api';
|
||||
|
||||
/** Schriftarten wie im Konfigurator/manuellen Druck. */
|
||||
@@ -99,7 +99,7 @@ export default function Textmenge() {
|
||||
const [gross, setGross] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetchFormats()
|
||||
fetchCheckFormats()
|
||||
.then((f) => {
|
||||
setFormate(f);
|
||||
setFormat(f.find((x) => x.key === 'a4')?.key ?? f[0]?.key ?? 'a4');
|
||||
|
||||
Reference in New Issue
Block a user