Bugs fixed
parent
8e66dada93
commit
525cd00055
|
|
@ -14,7 +14,7 @@ import Footer from "@/components/Footer";
|
||||||
import { Swiper, SwiperSlide } from "swiper/react";
|
import { Swiper, SwiperSlide } from "swiper/react";
|
||||||
// Import Swiper styles
|
// Import Swiper styles
|
||||||
import "swiper/css";
|
import "swiper/css";
|
||||||
import 'swiper/css/navigation';
|
import "swiper/css/navigation";
|
||||||
// import required modules
|
// import required modules
|
||||||
import { Autoplay, Navigation } from "swiper/modules";
|
import { Autoplay, Navigation } from "swiper/modules";
|
||||||
import { sliderItems } from "@/constants";
|
import { sliderItems } from "@/constants";
|
||||||
|
|
@ -74,7 +74,7 @@ export default function Landing() {
|
||||||
pagination={{
|
pagination={{
|
||||||
clickable: true,
|
clickable: true,
|
||||||
}}
|
}}
|
||||||
modules={[Autoplay , Navigation]}
|
modules={[Autoplay, Navigation]}
|
||||||
className="mySwiper w-full h-full"
|
className="mySwiper w-full h-full"
|
||||||
>
|
>
|
||||||
{data?.length > 0 ? (
|
{data?.length > 0 ? (
|
||||||
|
|
@ -148,6 +148,9 @@ export default function Landing() {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
localStorage.setItem("unknown", "true");
|
localStorage.setItem("unknown", "true");
|
||||||
}
|
}
|
||||||
|
if (item.id == 2) {
|
||||||
|
localStorage.removeItemItem("unknown");
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<p className="text-xs text-center font-medium text-gray hidden group-hover:flex group-hover:text-white">
|
<p className="text-xs text-center font-medium text-gray hidden group-hover:flex group-hover:text-white">
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ export default function CitizenLogin() {
|
||||||
localStorage.setItem("verificationToken", res);
|
localStorage.setItem("verificationToken", res);
|
||||||
},
|
},
|
||||||
onError: (err: any | string) => {
|
onError: (err: any | string) => {
|
||||||
|
refetch();
|
||||||
toast(<>{err.response.data.detail}</>, {
|
toast(<>{err.response.data.detail}</>, {
|
||||||
className: "!bg-red-500 !text-white",
|
className: "!bg-red-500 !text-white",
|
||||||
});
|
});
|
||||||
|
|
@ -77,7 +78,6 @@ export default function CitizenLogin() {
|
||||||
value: data.captcha,
|
value: data.captcha,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
refetch();
|
|
||||||
loginMutation.mutateAsync(payload);
|
loginMutation.mutateAsync(payload);
|
||||||
saveData({
|
saveData({
|
||||||
phoneNumber: data.phoneNumber,
|
phoneNumber: data.phoneNumber,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export default function ComplainsDetails({
|
||||||
const [open, setOpen] = useState<boolean>(
|
const [open, setOpen] = useState<boolean>(
|
||||||
state == "FollowResult" ? false : true
|
state == "FollowResult" ? false : true
|
||||||
);
|
);
|
||||||
const [password, setPassword] = useState<any>(true);
|
const [password, setPassword] = useState<any>(null);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const storeData = useData((state) => state.data);
|
const storeData = useData((state) => state.data);
|
||||||
let data;
|
let data;
|
||||||
|
|
@ -136,11 +136,17 @@ export default function ComplainsDetails({
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (getComplaintMutation.isSuccess && !Data) {
|
useEffect(() => {
|
||||||
data = getComplaintMutation.data;
|
const tk = localStorage.getItem("trackingNumber2");
|
||||||
} else {
|
const pw = localStorage.getItem("password2");
|
||||||
data = Data;
|
if (tk && pw) {
|
||||||
|
getComplaintMutation.mutate({
|
||||||
|
Data: { trackingNumber: tk, password: pw },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
data = getComplaintMutation?.data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
@ -178,9 +184,9 @@ export default function ComplainsDetails({
|
||||||
</AlertDialogFooter>
|
</AlertDialogFooter>
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
{data ? (
|
{getComplaintMutation.data && !getComplaintMutation.isPending ? (
|
||||||
<>
|
<>
|
||||||
{state !== "FollowResult" && (
|
{/* {state !== "FollowResult" && (
|
||||||
<button
|
<button
|
||||||
onClick={() => router.push("/Account/Complaints")}
|
onClick={() => router.push("/Account/Complaints")}
|
||||||
className="flex gap-1 my-2 cursor-pointer text-blue"
|
className="flex gap-1 my-2 cursor-pointer text-blue"
|
||||||
|
|
@ -190,7 +196,7 @@ export default function ComplainsDetails({
|
||||||
</span>
|
</span>
|
||||||
<p>بازگشت</p>
|
<p>بازگشت</p>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)} */}
|
||||||
|
|
||||||
{/* Editt */}
|
{/* Editt */}
|
||||||
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col">
|
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col">
|
||||||
|
|
@ -202,17 +208,20 @@ export default function ComplainsDetails({
|
||||||
انجام عملیات
|
انجام عملیات
|
||||||
</p>
|
</p>
|
||||||
<InspectorOperations
|
<InspectorOperations
|
||||||
updateData={() => getComplaintMutation.mutate(storeData)}
|
updateData={(payload) =>
|
||||||
|
getComplaintMutation.mutate({ Data: payload })
|
||||||
|
}
|
||||||
role={role}
|
role={role}
|
||||||
complaintData={data}
|
complaintData={data}
|
||||||
|
password={password}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 2 */}
|
{/* 2 */}
|
||||||
<div className="flex flex-col self-stretch w-full gap-2 rounded-lg lg:w-2/3 ">
|
<div className="flex flex-col self-stretch w-full gap-2 rounded-lg lg:w-2/3 ">
|
||||||
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col md:flex-row gap-2 items-center justify-center lg:sticky top-28">
|
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col md:flex-row gap-2 items-center justify-center">
|
||||||
{data.user == null ? (
|
{data?.user == null ? (
|
||||||
<>
|
<>
|
||||||
<div className="relative flex flex-col w-full p-5 mt-2 border border-gray-400 rounded-md gap-y-1">
|
<div className="relative flex flex-col w-full p-5 mt-2 border border-gray-400 rounded-md gap-y-1">
|
||||||
<p className=" absolute -top-3 right-2 bg-[#E9E9E9] px-2 text-sm text-gray-500">
|
<p className=" absolute -top-3 right-2 bg-[#E9E9E9] px-2 text-sm text-gray-500">
|
||||||
|
|
|
||||||
|
|
@ -61,14 +61,12 @@ export default function FollowResult() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const printableContent = "This is the content to be printed.";
|
const printableContent = "This is the content to be printed.";
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] pt-6 mx-auto">
|
<div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] pt-6 mx-auto">
|
||||||
{complaintPrintMutation?.data ? (
|
|
||||||
<>
|
<>
|
||||||
<button
|
{/* <button
|
||||||
onClick={() => router.push("/FollowUp")}
|
onClick={() => router.push("/FollowUp")}
|
||||||
className="flex gap-1 cursor-pointer text-blue"
|
className="flex gap-1 cursor-pointer text-blue"
|
||||||
>
|
>
|
||||||
|
|
@ -76,16 +74,13 @@ export default function FollowResult() {
|
||||||
<ArrowRight />
|
<ArrowRight />
|
||||||
</span>
|
</span>
|
||||||
<p>بازگشت</p>
|
<p>بازگشت</p>
|
||||||
</button>
|
</button> */}
|
||||||
<ComplainsDetails
|
<ComplainsDetails
|
||||||
role="Citizen"
|
role="Citizen"
|
||||||
state="FollowResult"
|
state="FollowResult"
|
||||||
Data={complaintPrintMutation?.data}
|
Data={complaintPrintMutation?.data}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -38,22 +38,17 @@ export default function InspectorOperations({
|
||||||
complaintData,
|
complaintData,
|
||||||
role,
|
role,
|
||||||
updateData,
|
updateData,
|
||||||
|
password,
|
||||||
}: {
|
}: {
|
||||||
complaintData: any;
|
complaintData: any;
|
||||||
role: string;
|
role: string;
|
||||||
updateData: () => any;
|
updateData: (data: any) => any;
|
||||||
|
password?: string;
|
||||||
}) {
|
}) {
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
text: z
|
text: z.string({ required_error: "لطفا متن خود را وارد نمایید." }),
|
||||||
.string({ required_error: "لطفا متن خود را وارد نمایید." })
|
|
||||||
.min(8, {
|
|
||||||
message: "Bio must be at least 8 characters.",
|
|
||||||
})
|
|
||||||
.max(260, {
|
|
||||||
message: "Bio must not be longer than 30 characters.",
|
|
||||||
}),
|
|
||||||
operation: z.string({
|
operation: z.string({
|
||||||
required_error: "Please select an email to display.",
|
required_error: "لطفا نوع عملیات را انتخاب نمایید.",
|
||||||
}),
|
}),
|
||||||
media: z
|
media: z
|
||||||
.custom<FileList>((val) => val instanceof FileList, "Required")
|
.custom<FileList>((val) => val instanceof FileList, "Required")
|
||||||
|
|
@ -61,12 +56,7 @@ export default function InspectorOperations({
|
||||||
.refine((files) => files.length <= 5, `Maximum of 5 File are allowed.`)
|
.refine((files) => files.length <= 5, `Maximum of 5 File are allowed.`)
|
||||||
.nullish(),
|
.nullish(),
|
||||||
});
|
});
|
||||||
const password = useData((state) => state.data.password);
|
|
||||||
const possibleOperations = complaintData?.possibleOperationsWithDescription;
|
const possibleOperations = complaintData?.possibleOperationsWithDescription;
|
||||||
const selectOptions = Operations.filter((item, index) =>
|
|
||||||
possibleOperations.includes(index)
|
|
||||||
);
|
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
const form = useForm<z.infer<typeof FormSchema>>({
|
||||||
resolver: zodResolver(FormSchema),
|
resolver: zodResolver(FormSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|
@ -79,12 +69,19 @@ export default function InspectorOperations({
|
||||||
|
|
||||||
const OperationMutation = useMutation({
|
const OperationMutation = useMutation({
|
||||||
mutationKey: ["Operation"],
|
mutationKey: ["Operation"],
|
||||||
mutationFn:
|
mutationFn: postComplaintsDetails,
|
||||||
role == "Inspector" ? OperateByInspector : postComplaintsDetails,
|
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
toast("عملیات شما با موفقیت انجام شد. ", {
|
toast("عملیات شما با موفقیت انجام شد. ", {
|
||||||
className: "!bg-green-500 !text-white",
|
className: "!bg-green-500 !text-white",
|
||||||
});
|
});
|
||||||
|
console.log(complaintData.trackingNumber);
|
||||||
|
console.log(localStorage.getItem("password2") as string);
|
||||||
|
updateData({
|
||||||
|
trackingNumber: complaintData.trackingNumber,
|
||||||
|
password: password
|
||||||
|
? password
|
||||||
|
: (localStorage.getItem("password2") as string),
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onError: (err: any | string) => {
|
onError: (err: any | string) => {
|
||||||
toast(<>{err.response.data.detail}</>, {
|
toast(<>{err.response.data.detail}</>, {
|
||||||
|
|
@ -98,7 +95,10 @@ export default function InspectorOperations({
|
||||||
formData.append("text", data.text);
|
formData.append("text", data.text);
|
||||||
formData.append("trackingNumber", complaintData.trackingNumber);
|
formData.append("trackingNumber", complaintData.trackingNumber);
|
||||||
formData.append("Operation", data.operation);
|
formData.append("Operation", data.operation);
|
||||||
formData.append("password", localStorage.getItem("password2") as string);
|
formData.append(
|
||||||
|
"password",
|
||||||
|
password ? password : (localStorage.getItem("password2") as string)
|
||||||
|
);
|
||||||
if (data?.media && data?.media?.length > 0) {
|
if (data?.media && data?.media?.length > 0) {
|
||||||
for (let i = 0; i < data.media.length; i++) {
|
for (let i = 0; i < data.media.length; i++) {
|
||||||
formData.append("Medias", data.media[i]);
|
formData.append("Medias", data.media[i]);
|
||||||
|
|
|
||||||
|
|
@ -7,49 +7,38 @@ import { twMerge } from "tailwind-merge";
|
||||||
const items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
|
const items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
|
||||||
|
|
||||||
export default function Pagination({
|
export default function Pagination({
|
||||||
itemsPerPage,
|
TotalPages,
|
||||||
|
currentPage,
|
||||||
|
PageSize,
|
||||||
Page,
|
Page,
|
||||||
countPage,
|
countPage,
|
||||||
length,
|
length,
|
||||||
}: {
|
}: {
|
||||||
itemsPerPage?: any;
|
TotalPages?: any;
|
||||||
|
currentPage?: any;
|
||||||
|
PageSize?: number;
|
||||||
Page?: any;
|
Page?: any;
|
||||||
countPage?: any;
|
countPage?: any;
|
||||||
length?: any;
|
length?: any;
|
||||||
}) {
|
}) {
|
||||||
// Here we use item offsets; we could also use page offsets
|
|
||||||
// following the API or data you're working with.
|
|
||||||
const [itemOffset, setItemOffset] = useState(0);
|
|
||||||
|
|
||||||
// Simulate fetching items from another resources.
|
|
||||||
// (This could be items from props; or items loaded in a local state
|
|
||||||
// from an API endpoint with useEffect and useState)
|
|
||||||
const endOffset = itemOffset + itemsPerPage;
|
|
||||||
|
|
||||||
const currentItems = items.slice(itemOffset, endOffset);
|
|
||||||
const pageCount = Math.ceil(items.length / itemsPerPage);
|
|
||||||
|
|
||||||
// Invoke when user click to request another page.
|
|
||||||
const handlePageClick = (event: any) => {
|
const handlePageClick = (event: any) => {
|
||||||
const newOffset = (event.selected * itemsPerPage) % items.length;
|
|
||||||
setItemOffset(newOffset);
|
|
||||||
Page(event.selected);
|
Page(event.selected);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <Items currentItems={currentItems} /> */}
|
|
||||||
<ReactPaginate
|
<ReactPaginate
|
||||||
breakLabel="..."
|
breakLabel="..."
|
||||||
onPageActive={(e) => console.log(e)}
|
onPageActive={(e) => console.log(e)}
|
||||||
nextLabel={<MdKeyboardArrowLeft className="w-5 h-5 " />}
|
nextLabel={<MdKeyboardArrowLeft className="w-5 h-5 " />}
|
||||||
onPageChange={handlePageClick}
|
onPageChange={handlePageClick}
|
||||||
pageRangeDisplayed={3}
|
pageRangeDisplayed={3}
|
||||||
pageCount={Math.ceil(countPage / 5)}
|
forcePage={currentPage}
|
||||||
|
pageCount={TotalPages}
|
||||||
previousLabel={<MdKeyboardArrowRight className="w-5 h-5 " />}
|
previousLabel={<MdKeyboardArrowRight className="w-5 h-5 " />}
|
||||||
pageClassName=" w-10 h-10 grid place-content-center rounded-lg !text-blue shadow-md"
|
pageClassName=" w-10 h-10 grid place-content-center rounded-lg !text-blue shadow-md"
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
" flex flex-wrap gap-3 text-sm md:text-base w-full rounded-md p-1 bg-white/30 backdrop-blur-lg justify-center text-blue mt-5 absolute left-0 right-0 bottom-6"
|
" flex flex-wrap gap-3 text-sm md:text-base w-full rounded-md p-2 pb-3 bg-white/30 backdrop-blur-lg justify-center text-blue mt-5 fixed left-0 right-0 bottom-0"
|
||||||
)}
|
)}
|
||||||
activeClassName=" bg-blue text-blue shadow-md shadow-main"
|
activeClassName=" bg-blue text-blue shadow-md shadow-main"
|
||||||
activeLinkClassName=" text-white w-full p-1 h-full"
|
activeLinkClassName=" text-white w-full p-1 h-full"
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ export default function ProfileDropDown() {
|
||||||
saveToken(false);
|
saveToken(false);
|
||||||
deleteCookie("Sootzani_Refresh_Token");
|
deleteCookie("Sootzani_Refresh_Token");
|
||||||
deleteCookie("Sootzani_Token");
|
deleteCookie("Sootzani_Token");
|
||||||
|
localStorage.removeItem("password2");
|
||||||
|
localStorage.removeItem("trackingNumber2");
|
||||||
router.push("/");
|
router.push("/");
|
||||||
};
|
};
|
||||||
const saveToken = useToken((state) => state.saveToken);
|
const saveToken = useToken((state) => state.saveToken);
|
||||||
|
|
@ -71,7 +73,9 @@ export default function ProfileDropDown() {
|
||||||
<DropdownMenuTrigger className=" max-sm:-mr-8 max-sm:text-xs" asChild>
|
<DropdownMenuTrigger className=" max-sm:-mr-8 max-sm:text-xs" asChild>
|
||||||
<Button variant="outline">
|
<Button variant="outline">
|
||||||
{/* {profileData?.title ? profileData?.title : profileData?.userName} */}
|
{/* {profileData?.title ? profileData?.title : profileData?.userName} */}
|
||||||
{profileData?.firstName || profileData?.lastName ? profileData?.firstName +" "+ profileData?.lastName : profileData?.userName}
|
{profileData?.firstName || profileData?.lastName
|
||||||
|
? profileData?.firstName + " " + profileData?.lastName
|
||||||
|
: profileData?.userName}
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent className="w-56 sm:ml-10">
|
<DropdownMenuContent className="w-56 sm:ml-10">
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,11 @@ export default function RequestStep2() {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
localStorage.setItem("trackingNumber", res.trackingNumber);
|
localStorage.setItem("trackingNumber", res.trackingNumber);
|
||||||
localStorage.setItem("password", res.password);
|
localStorage.setItem("password", res.password);
|
||||||
|
localStorage.removeItem("unknown");
|
||||||
router.push("/RequestResult");
|
router.push("/RequestResult");
|
||||||
},
|
},
|
||||||
onError: (err: any | string) => {
|
onError: (err: any | string) => {
|
||||||
|
refetch();
|
||||||
toast(<>{err.response.data.detail}</>, {
|
toast(<>{err.response.data.detail}</>, {
|
||||||
className: "!bg-red-500 !text-white",
|
className: "!bg-red-500 !text-white",
|
||||||
});
|
});
|
||||||
|
|
@ -133,9 +135,11 @@ export default function RequestStep2() {
|
||||||
localStorage.setItem("password", res.password);
|
localStorage.setItem("password", res.password);
|
||||||
localStorage.setItem("registeredAt", res.registeredAt);
|
localStorage.setItem("registeredAt", res.registeredAt);
|
||||||
localStorage.removeItem("authorized");
|
localStorage.removeItem("authorized");
|
||||||
|
localStorage.removeItem("unknown");
|
||||||
router.push("/RequestResult");
|
router.push("/RequestResult");
|
||||||
},
|
},
|
||||||
onError: (err: any | string) => {
|
onError: (err: any | string) => {
|
||||||
|
refetch();
|
||||||
toast(<>{err.response.data.detail}</>, {
|
toast(<>{err.response.data.detail}</>, {
|
||||||
className: "!bg-red-500 !text-white",
|
className: "!bg-red-500 !text-white",
|
||||||
});
|
});
|
||||||
|
|
@ -204,7 +208,6 @@ export default function RequestStep2() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
refetch();
|
|
||||||
resetField("Title");
|
resetField("Title");
|
||||||
resetField("Text");
|
resetField("Text");
|
||||||
resetField("Medias");
|
resetField("Medias");
|
||||||
|
|
@ -373,7 +376,6 @@ export default function RequestStep2() {
|
||||||
const files: File[] = Array.from(uploadFile);
|
const files: File[] = Array.from(uploadFile);
|
||||||
// 2. now you can use array methods on files;
|
// 2. now you can use array methods on files;
|
||||||
filenames = files.map((file) => file?.name);
|
filenames = files.map((file) => file?.name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ export default function TabController() {
|
||||||
const [selectedFile, setSelectedFile] = useState<any>(null);
|
const [selectedFile, setSelectedFile] = useState<any>(null);
|
||||||
const [page, setPage] = useState<any>(1);
|
const [page, setPage] = useState<any>(1);
|
||||||
const [totalCount, setTotalCount] = useState<any>(0);
|
const [totalCount, setTotalCount] = useState<any>(0);
|
||||||
|
const [currentPage, setCurrentPage] = useState<any>(0);
|
||||||
|
const [pageSize, setPageSize] = useState<any>(0);
|
||||||
|
const [totalPages, setTotalPages] = useState<any>(0);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [search, setSearch] = useState<any>(null);
|
const [search, setSearch] = useState<any>(null);
|
||||||
|
|
||||||
|
|
@ -46,6 +49,9 @@ export default function TabController() {
|
||||||
if (data) {
|
if (data) {
|
||||||
const headersData = JSON.parse(data.headers["x-pagination"]);
|
const headersData = JSON.parse(data.headers["x-pagination"]);
|
||||||
setTotalCount(headersData.TotalCount);
|
setTotalCount(headersData.TotalCount);
|
||||||
|
setTotalPages(headersData.TotalPages);
|
||||||
|
setCurrentPage(headersData.CurrentPage);
|
||||||
|
setPageSize(headersData.PageSize);
|
||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
|
|
@ -55,11 +61,15 @@ export default function TabController() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 pt-9">
|
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 pt-9">
|
||||||
<Link href="/RequestStep2">
|
<Button
|
||||||
<Button className=" bg-blue hover:bg-blue/90 rounded-lg max-sm:text-xs">
|
onClick={() => {
|
||||||
|
router.push("/RequestStep2");
|
||||||
|
localStorage.removeItemItem("unknown");
|
||||||
|
}}
|
||||||
|
className=" bg-blue hover:bg-blue/90 rounded-lg max-sm:text-xs"
|
||||||
|
>
|
||||||
ثبت درخواست
|
ثبت درخواست
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Search
|
<Search
|
||||||
value={search}
|
value={search}
|
||||||
|
|
@ -69,6 +79,8 @@ export default function TabController() {
|
||||||
/>
|
/>
|
||||||
<TableController data={data?.data} />
|
<TableController data={data?.data} />
|
||||||
<Pagination
|
<Pagination
|
||||||
|
TotalPages={totalPages}
|
||||||
|
currentPage={currentPage - 1}
|
||||||
countPage={totalCount}
|
countPage={totalCount}
|
||||||
Page={(num: number) => setPage(num + 1)}
|
Page={(num: number) => setPage(num + 1)}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export default function TableController({ data }: { data: Complaint[] }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Table className="border-[1px] border-solid border-muted rounded-md ">
|
<Table className="border-[1px] border-solid border-muted rounded-md mb-20">
|
||||||
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
|
@ -122,7 +122,6 @@ export default function TableController({ data }: { data: Complaint[] }) {
|
||||||
: "-"}
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{/* </Link> */}
|
{/* </Link> */}
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.1.9",
|
"version": "0.1.10",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.1.9",
|
"version": "0.1.10",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.1.9",
|
"version": "0.1.10",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ export async function getComplaints({
|
||||||
states = 0,
|
states = 0,
|
||||||
TrackingNumber,
|
TrackingNumber,
|
||||||
PageNumber = 1,
|
PageNumber = 1,
|
||||||
PageSize = 5,
|
PageSize = 10,
|
||||||
}: {
|
}: {
|
||||||
states?: number;
|
states?: number;
|
||||||
TrackingNumber?: string;
|
TrackingNumber?: string;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue