diff --git a/client/src/pages/admin-gallery/ui/AdminGalleryPage.tsx b/client/src/pages/admin-gallery/ui/AdminGalleryPage.tsx index 4f1450f..271ff37 100644 --- a/client/src/pages/admin-gallery/ui/AdminGalleryPage.tsx +++ b/client/src/pages/admin-gallery/ui/AdminGalleryPage.tsx @@ -11,6 +11,13 @@ import { uploadAdminProductImages } from '@/entities/product/api/product-api' import { formatAdminImageMaxSizeHint } from '@/shared/constants/upload-limits' import { invalidateQueryKeys } from '@/shared/lib/invalidate-query-keys' import { GallerySliderSection } from './GallerySliderSection' +import type { AxiosError } from 'axios' + +function getApiErrorMessage(error: unknown): string | null { + const e = error as AxiosError<{ error?: string }> + const msg = e?.response?.data?.error + return msg ? String(msg) : null +} export function AdminGalleryPage() { const queryClient = useQueryClient() @@ -105,9 +112,7 @@ export function AdminGalleryPage() { )} {deleteMut.isError && ( - - {deleteMut.error instanceof Error ? deleteMut.error.message : 'Ошибка удаления'} - + {getApiErrorMessage(deleteMut.error) ?? 'Ошибка удаления'} )} diff --git a/scripts/deploy-auto.sh b/scripts/deploy-auto.sh index b7df4d4..84cdb09 100644 --- a/scripts/deploy-auto.sh +++ b/scripts/deploy-auto.sh @@ -117,7 +117,7 @@ else fi echo ">>> Diff: $LAST_DEPLOYED..HEAD" - CHANGED_FILES=$(git -C "$ROOT" diff --name-only "$LAST_DEPLOYED" HEAD 2>/dev/null || true) + CHANGED_FILES=$(cd "$ROOT" && git diff --name-only "$LAST_DEPLOYED" HEAD 2>/dev/null || true) if echo "$CHANGED_FILES" | grep -q "^client/"; then changed_client=true @@ -207,7 +207,7 @@ fi # --- Save deployed commit --- if [[ "$TARGET" == "auto" && "$FORCE" != true ]]; then - CURRENT_HEAD=$(git -C "$ROOT" rev-parse HEAD) + CURRENT_HEAD=$(cd "$ROOT" && git rev-parse HEAD) echo "$CURRENT_HEAD" > "$ROOT/.deployed-commit" echo ">>> Сохранён коммит $CURRENT_HEAD" fi