Textmengencheck: A5 + DIN lang via show_check
All checks were successful
Build & Deploy / deploy (push) Successful in 21s
All checks were successful
Build & Deploy / deploy (push) Successful in 21s
Neuer fetchCheckFormats() laedt Formate mit show_check=true (Text-Seiten- Formate A4/A5/DIN-lang/A6), unabhaengig von der oeffentlichen Bestellbarkeit. Textmenge nutzt das statt fetchFormats - so erscheinen A5 (hoch/quer) und DIN lang (komplett beschrieben) im Check, Adress-Postkarten bleiben aussen vor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -268,6 +268,19 @@ export async function fetchFormats(): Promise<Format[]> {
|
|||||||
return data?.data ?? [];
|
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) ─────────────────────────── */
|
/* ── Preis & Bestellung (Extension skrift-orders) ─────────────────────────── */
|
||||||
|
|
||||||
export type QuoteLine = { label: string; amount: number; per_unit?: boolean };
|
export type QuoteLine = { label: string; amount: number; per_unit?: boolean };
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useMemo, useState } from 'react';
|
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';
|
import type { Format, PublicSettings, PreviewDoc, PreviewOverflow } from '../lib/api';
|
||||||
|
|
||||||
/** Schriftarten wie im Konfigurator/manuellen Druck. */
|
/** Schriftarten wie im Konfigurator/manuellen Druck. */
|
||||||
@@ -99,7 +99,7 @@ export default function Textmenge() {
|
|||||||
const [gross, setGross] = useState(false);
|
const [gross, setGross] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchFormats()
|
fetchCheckFormats()
|
||||||
.then((f) => {
|
.then((f) => {
|
||||||
setFormate(f);
|
setFormate(f);
|
||||||
setFormat(f.find((x) => x.key === 'a4')?.key ?? f[0]?.key ?? 'a4');
|
setFormat(f.find((x) => x.key === 'a4')?.key ?? f[0]?.key ?? 'a4');
|
||||||
|
|||||||
Reference in New Issue
Block a user