forked from Transparency/kgroad-frontend2
fixed bugs
This commit is contained in:
1 parent
d4c49a1061
commit
b0870824ba
35 files changed
+1225
-420
No files matched your search
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user