fix: useState Hooks vor Early Return verschieben
This commit is contained in:
@@ -45,6 +45,11 @@ function BestellungDetail({ id, toast, onBack }) {
|
|||||||
const [pickerSearch,setPickerSearch]= useState('');
|
const [pickerSearch,setPickerSearch]= useState('');
|
||||||
const [editMode, setEditMode] = useState(false);
|
const [editMode, setEditMode] = useState(false);
|
||||||
const [form, setForm] = useState({ name:'', bemerkung:'', custom_price:'', status:'warteliste' });
|
const [form, setForm] = useState({ name:'', bemerkung:'', custom_price:'', status:'warteliste' });
|
||||||
|
const today = () => new Date().toISOString().slice(0,10);
|
||||||
|
const [bezahltDate, setBezahltDate] = useState(today());
|
||||||
|
const [abgeholtDate, setAbgeholtDate] = useState(today());
|
||||||
|
const [showBezahltPicker, setShowBezahltPicker] = useState(false);
|
||||||
|
const [showAbgeholtPicker, setShowAbgeholtPicker] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
api('/tools/kalkulator3d').then(d => setArchiv(d.own || d || [])).catch(()=>{});
|
api('/tools/kalkulator3d').then(d => setArchiv(d.own || d || [])).catch(()=>{});
|
||||||
@@ -124,12 +129,6 @@ function BestellungDetail({ id, toast, onBack }) {
|
|||||||
return 'warteliste';
|
return 'warteliste';
|
||||||
};
|
};
|
||||||
|
|
||||||
const today = () => new Date().toISOString().slice(0,10);
|
|
||||||
const [bezahltDate, setBezahltDate] = useState(today());
|
|
||||||
const [abgeholtDate, setAbgeholtDate] = useState(today());
|
|
||||||
const [showBezahltPicker, setShowBezahltPicker] = useState(false);
|
|
||||||
const [showAbgeholtPicker, setShowAbgeholtPicker] = useState(false);
|
|
||||||
|
|
||||||
function toggleBezahlt() {
|
function toggleBezahlt() {
|
||||||
if (!order.bezahlt) {
|
if (!order.bezahlt) {
|
||||||
// Noch nicht bezahlt → Datum-Picker anzeigen
|
// Noch nicht bezahlt → Datum-Picker anzeigen
|
||||||
|
|||||||
Reference in New Issue
Block a user