error added

This commit is contained in:
Samandar Turgunboyev
2025-12-11 18:42:32 +05:00
3 changed files with 52 additions and 4 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm i ---force
COPY . .
RUN npm run build
FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/dist /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
RUN echo 'server { \
listen 80; \
server_name _; \
root /usr/share/nginx/html; \
index index.html; \
location / { \
try_files $uri /index.html; \
} \
error_page 404 /index.html; \
}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

12
docker-compose.yaml Normal file
View File

@@ -0,0 +1,12 @@
services:
frontend:
build: .
container_name: meridyn-admin
ports:
- "3002:80"
volumes:
- .:/app
- /app/node_modules
environment:
- CHOKIDAR_USEPOLLING=true
- HOST=0.0.0.0

View File

@@ -64,10 +64,15 @@ export default function AddDistrict({ initialValues, setDialogOpen }: Props) {
const messageText = errMessage.message;
const errMessageName = err.response?.data as { data: { name: [string] } };
const messageTextName = errMessageName.data.name[0];
toast.error(messageTextName || messageText || "Xatolik yuz berdi", {
richColors: true,
position: "top-center",
});
toast.error(
(messageTextName && "Bu tuman oldin qo'shilgan") ||
messageText ||
"Xatolik yuz berdi",
{
richColors: true,
position: "top-center",
},
);
},
});