feat: KoePi Admin-Button zum Neu-Aufloesen der Filial-Whitelist
This commit is contained in:
@@ -183,6 +183,18 @@ export default function Koepi({ toast }) {
|
||||
finally { setCronRunning(false); }
|
||||
};
|
||||
|
||||
const [resolvingStores, setResolvingStores] = useState(false);
|
||||
const resolveStores = async () => {
|
||||
setResolvingStores(true);
|
||||
try {
|
||||
const r = await api('/tools/koepi/local-stores/resolve', { method:'POST', body:{} });
|
||||
toast(`🏪 Filial-Liste: ${r.resolved} von ${r.total} aufgelöst`);
|
||||
setOffers(null); setProspekte(null);
|
||||
setTimeout(() => { if (tab==='angebote') loadOffers(true); else loadProspekte(true); }, 100);
|
||||
} catch(e) { toast?.(e.message||'Fehler','error'); }
|
||||
finally { setResolvingStores(false); }
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth:700, margin:'0 auto' }}>
|
||||
{/* Header */}
|
||||
@@ -196,13 +208,16 @@ export default function Koepi({ toast }) {
|
||||
<button onClick={testDailyCheck} disabled={cronRunning} style={{ ...S.btn('#f59e0b',true), fontSize:10, opacity:cronRunning?0.5:1 }}>
|
||||
{cronRunning ? '⏳ läuft…' : '🔔 Cron testen'}
|
||||
</button>
|
||||
<button onClick={resolveStores} disabled={resolvingStores} style={{ ...S.btn('#4ecdc4',true), fontSize:10, opacity:resolvingStores?0.5:1 }}>
|
||||
{resolvingStores ? '⏳ läuft…' : '🏪 Filial-Liste neu auflösen'}
|
||||
</button>
|
||||
<button onClick={clearCache} style={{ ...S.btn('#666666',true), fontSize:10 }}>🗑 Cache leeren</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div style={{ color:'rgba(255,255,255,0.3)', fontFamily:'monospace', fontSize:10, marginBottom:14 }}>
|
||||
Raum Duisburg 47259 · EDEKA · REWE · Netto · Kaufland · Penny · Trinkgut · Cache 1h
|
||||
Raum Duisburg 47259 · EDEKA · REWE · Netto · Kaufland · Penny · Trinkgut · Lidl · ALDI Süd · HORNBACH · Cache 1h
|
||||
</div>
|
||||
|
||||
{/* Tabs */}
|
||||
|
||||
Reference in New Issue
Block a user