error added
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal 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
12
docker-compose.yaml
Normal 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
|
||||
@@ -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",
|
||||
},
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user