fix: odstranění matoucích chybových hlášek z dialogu Správa obchodů
CI / Generate TypeScript types (push) Successful in 10s
CI / Server unit tests (push) Successful in 26s
CI / Build server (push) Successful in 28s
CI / Build client (push) Successful in 41s
CI / Playwright E2E tests (push) Successful in 1m47s
CI / Build and push Docker image (push) Successful in 45s
CI / Notify (push) Successful in 2s

This commit is contained in:
2026-08-25 11:49:18 +02:00
parent 6f6567a2a9
commit e5fc358c0a
3 changed files with 5 additions and 4 deletions
@@ -42,10 +42,9 @@ export default function StoreAdminModal({ isOpen, onClose, stores, onStoresChang
const setUrlAt = (urls: string[], index: number, value: string) =>
urls.map((u, i) => (i === index ? value : u));
/** Zpracuje odpověď API — vrací true při úspěchu. */
/** Zpracuje odpověď API — vrací true při úspěchu. Chybu z API hlásí globální toaster. */
const applyResult = (res: { data?: unknown; error?: unknown }): boolean => {
if (res.error) {
setError((res.error as any).error || 'Nastala chyba');
return false;
}
if (res.data) {
+2 -1
View File
@@ -31,7 +31,8 @@ getConfig().then(({ data }) => {
client.interceptors.response.use(async response => {
// TODO opravit - login je zatím výjimka, voláme ho "naprázdno" abychom zjistili, zda nás nepřihlásily trusted headers
if (!response.ok && !response.url.includes("/login")) {
const json = await response.json();
// Čteme z klonu, aby tělo odpovědi zůstalo k dispozici i generovanému SDK
const json = await response.clone().json();
toast.error(json.error, { theme: "colored" });
// Serverové chyby hlásíme do Sentry; 4xx jsou očekávané (chyby uživatele)
if (response.status >= 500) {