fixed bugs

This commit is contained in:
Alibek committed 2024-02-19 15:14:19 +06:00
1 parent d4c49a1061
commit b0870824ba
35 files changed
+1225 -420

No files matched your search

+6 -24
View File
@@ -1,32 +1,14 @@
import { apiInstance } from "@/shared/config/apiConfig";
import { authConfig } from "@/shared/config/authConfig";
import { IMyReportsList } from "@/shared/types/my-reports";
import ProfileTable from "@/widgets/ProfileTable/ProfileTable";
import { getServerSession } from "next-auth";
import React from "react";
const MyReports = async () => {
const session = await getServerSession(authConfig);
const getMyReports = async () => {
const Authorization = `Bearer ${session?.access_token}`;
const config = {
headers: {
Authorization,
},
};
const res = await apiInstance.get<IMyReportsList>(
"/users/reports/",
config
);
return res.data;
};
const data: IMyReportsList = await getMyReports();
const MyReports = async ({
searchParams,
}: {
searchParams: { ["страница-обращений"]: string };
}) => {
return (
<div>
<ProfileTable reports={data} />
<ProfileTable searchParams={searchParams} />
</div>
);
};