diff --git a/pages/cart/reports/list.tsx b/pages/cart/reports/list.tsx index d16e9a2..03c3d78 100644 --- a/pages/cart/reports/list.tsx +++ b/pages/cart/reports/list.tsx @@ -22,7 +22,7 @@ export default function Reports() { const deleteReport = (id) => { axiosInstance - .delete(`api/data/reports/${id}`) + .delete(`/api/data/reports/${id}`) .then((res) => { toast.success("Успешно изтрит отчет"); // router.push("/cart/reports/list"); @@ -43,12 +43,12 @@ export default function Reports() { const { data } = await axiosInstance.get("/api/data/locations"); setLocations(data); console.log(data); - axiosInstance.get(`/api/data/reports`) + axiosInstance.get(`/api/data/reports?include=publisher,location`) .then((res) => { - let reports = res.data; - reports.forEach((report) => { - report.location = data.find((loc) => loc.id === report.locationId); - }); + // let reports = res.data; + // reports.forEach((report) => { + // report.location = data.find((loc) => loc.id === report.locationId); + // }); setReports(res.data); }) .catch((err) => { @@ -78,6 +78,7 @@ export default function Reports() {
От | Дата | Място | Отчет | @@ -87,9 +88,10 @@ export default function Reports() {||||
---|---|---|---|---|---|---|---|
{common.getDateFormated(new Date(report.date))} | -{report.location?.name} | -+ | {report.publisher.firstName + " " + report.publisher.lastName} | +{common.getDateFormated(new Date(report.date))} | +{report.location?.name} | +
{(report.experienceInfo === null || report.experienceInfo === "")
? (
<>
@@ -99,12 +101,19 @@ export default function Reports() {
Клипове: {report.videoCount} Адреси / Телефони: {report.returnVisitInfoCount} > + ) : (report.placementCount > 0) ? ( + <> + Отзив
+
+ >
) : (
<>
Случка
>
- )}
+ )
+
+ }
|
@@ -122,8 +131,8 @@ export default function Reports() {
-
-
+
+
);
}
diff --git a/pages/permits.tsx b/pages/permits.tsx
index a4d359e..2ffced7 100644
--- a/pages/permits.tsx
+++ b/pages/permits.tsx
@@ -9,10 +9,19 @@ const PDFViewerPage = ({ pdfFiles }) => {
return (
Разрешителни+Разрешителни {/* Adjust the 100px based on your header/footer size */}
-
+ {/*
+ {pdfFiles.map((file, index) => ( + + ))} + */} {pdfFiles.map((file, index) => ( + //
- < object data={file.url} type="application/pdf" style={{ width: '100%', height: '100%' }}>
-
-
+ <>
+ Вашият браузър не поддържа PDFs файлове. Моля свалете файла за да го разгледате: Свали {file.name}. -Your browser does not support PDFs. Please download the PDF to view it: {file.name}. - -
+ < object data={file.url} type="application/pdf" style={{ width: '100%', height: '100%' }}>
+
+ >
))}
Вашият браузър не поддържа PDFs файлове. Моля свалете файла за да го разгледате: Свали {file.name}. +Your browser does not support PDFs. Please download the PDF to view it: {file.name}. + + |