Bugs fixed
parent
e3c4d1ebf8
commit
05a851333d
|
|
@ -2,7 +2,7 @@ import type { Metadata } from "next";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { Toaster } from "@/components/ui/toaster";
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
import Navbar from "@/components/Navbar";
|
import Navbar from "@/components/Navbar";
|
||||||
import Provider from "../utils/Provider";
|
import Provider from "../utils/ReactQuery/Provider";
|
||||||
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
|
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
|
||||||
import ProgressBarProviders from "@/components/ProgressBar";
|
import ProgressBarProviders from "@/components/ProgressBar";
|
||||||
import { unstable_noStore as noStore } from "next/cache";
|
import { unstable_noStore as noStore } from "next/cache";
|
||||||
|
|
|
||||||
|
|
@ -149,8 +149,8 @@ export default function ComplainsDetails({
|
||||||
data = getComplaintMutation?.data;
|
data = getComplaintMutation?.data;
|
||||||
const possibleOperations = data?.possibleOperationsWithDescription;
|
const possibleOperations = data?.possibleOperationsWithDescription;
|
||||||
if (possibleOperations?.length == 0) {
|
if (possibleOperations?.length == 0) {
|
||||||
localStorage.removeItem("trackingNumber2");
|
localStorage.removeItem("trackingNumber2");
|
||||||
localStorage.removeItem("password2");
|
localStorage.removeItem("password2");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -205,7 +205,7 @@ export default function ComplainsDetails({
|
||||||
)} */}
|
)} */}
|
||||||
|
|
||||||
{/* Editt */}
|
{/* Editt */}
|
||||||
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col mb-10">
|
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col lg:h-[80vh] mb-10">
|
||||||
{/* 1 */}
|
{/* 1 */}
|
||||||
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3">
|
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3">
|
||||||
{/* ***** */}
|
{/* ***** */}
|
||||||
|
|
@ -253,6 +253,12 @@ export default function ComplainsDetails({
|
||||||
{data.complaining ? data.complaining : "-"}
|
{data.complaining ? data.complaining : "-"}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
<p className="text-[#464646] text-sm font-medium">
|
||||||
|
کد پیگیری:{" "}
|
||||||
|
<span className="text-[#7C838A] text-sm font-medium">
|
||||||
|
{data.trackingNumber ? data.trackingNumber : "-"}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
<p className="text-[#464646] text-sm font-medium">
|
<p className="text-[#464646] text-sm font-medium">
|
||||||
زمان ثبت:{" "}
|
زمان ثبت:{" "}
|
||||||
<span className="text-[#7C838A] text-sm font-medium">
|
<span className="text-[#7C838A] text-sm font-medium">
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,11 @@ import { toast } from "sonner";
|
||||||
import { Oval } from "react-loader-spinner";
|
import { Oval } from "react-loader-spinner";
|
||||||
|
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
trackingNumber: z.string().min(2, {
|
trackingNumber: z.string().min(1, {
|
||||||
message: "trackingNumber must be at least 2 characters.",
|
message: "لطفا کد پیگیری را وارد نمایید.",
|
||||||
}),
|
}),
|
||||||
password: z.string().min(4, {
|
password: z.string().min(1, {
|
||||||
message: "Password must be at least 4 characters.",
|
message: "لطفا رمز عبور خود را وارد نمایید.",
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ export default function FollowUp() {
|
||||||
|
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
const result = res;
|
const result = res;
|
||||||
|
|
||||||
// router.push("/FollowResult");
|
// router.push("/FollowResult");
|
||||||
router.push("/FollowResult", { data: JSON.stringify(result) });
|
router.push("/FollowResult", { data: JSON.stringify(result) });
|
||||||
},
|
},
|
||||||
|
|
@ -73,7 +73,7 @@ export default function FollowUp() {
|
||||||
// </pre>
|
// </pre>
|
||||||
// ),
|
// ),
|
||||||
// });
|
// });
|
||||||
|
|
||||||
localStorage.setItem("trackingNumber2", data.trackingNumber);
|
localStorage.setItem("trackingNumber2", data.trackingNumber);
|
||||||
localStorage.setItem("password2", data.password);
|
localStorage.setItem("password2", data.password);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,21 +30,21 @@ const FormSchema = z.object({
|
||||||
lastName: z.string().min(1, {
|
lastName: z.string().min(1, {
|
||||||
message: "لطفا نام خانوادگی خود را وارد نمایید.",
|
message: "لطفا نام خانوادگی خود را وارد نمایید.",
|
||||||
}),
|
}),
|
||||||
nationalId: z
|
// nationalId: z
|
||||||
.string()
|
// .string()
|
||||||
.length(10, { message: "کد ملی معتبر نمی باشد." })
|
// .length(10, { message: "کد ملی معتبر نمی باشد." })
|
||||||
.transform((value) => {
|
// .transform((value) => {
|
||||||
const parsedNumber = Number(value);
|
// const parsedNumber = Number(value);
|
||||||
if (Number.isNaN(parsedNumber)) {
|
// if (Number.isNaN(parsedNumber)) {
|
||||||
throw new Error("کد ملی معتبر نمی باشد.");
|
// throw new Error("کد ملی معتبر نمی باشد.");
|
||||||
} else if (
|
// } else if (
|
||||||
Number(parsedNumber) > 100000000 &&
|
// Number(parsedNumber) > 100000000 &&
|
||||||
Number(parsedNumber) < 999999999
|
// Number(parsedNumber) < 999999999
|
||||||
) {
|
// ) {
|
||||||
throw new Error("کد ملی معتبر نمی باشد.");
|
// throw new Error("کد ملی معتبر نمی باشد.");
|
||||||
}
|
// }
|
||||||
return parsedNumber;
|
// return parsedNumber;
|
||||||
}),
|
// }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function RequestStep1() {
|
export default function RequestStep1() {
|
||||||
|
|
@ -82,21 +82,12 @@ export default function RequestStep1() {
|
||||||
if (profileData) {
|
if (profileData) {
|
||||||
form.setValue("firstName", profileData.firstName);
|
form.setValue("firstName", profileData.firstName);
|
||||||
form.setValue("lastName", profileData.lastName);
|
form.setValue("lastName", profileData.lastName);
|
||||||
form.setValue("nationalId", profileData.nationalId);
|
|
||||||
}
|
}
|
||||||
}, [profileData]);
|
}, [profileData]);
|
||||||
|
|
||||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||||
// toast({
|
// const strNationalId = String(data.nationalId);
|
||||||
// title: "You submitted the following values:",
|
const payload = data;
|
||||||
// description: (
|
|
||||||
// <pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
|
|
||||||
// <code className="text-white">{JSON.stringify(data, null, 2)}</code>
|
|
||||||
// </pre>
|
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
const strNationalId = String(data.nationalId);
|
|
||||||
const payload = { ...data, nationalId: strNationalId };
|
|
||||||
editProfileMutation.mutate(payload);
|
editProfileMutation.mutate(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const buttonVariants = cva(
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
default: "bg-primary text-primary-foreground hover:bg-blue/90",
|
||||||
destructive:
|
destructive:
|
||||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||||
outline:
|
outline:
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ export async function getProfile() {
|
||||||
export async function editProfile(payload: {
|
export async function editProfile(payload: {
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
nationalId: string;
|
nationalId?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
}) {
|
}) {
|
||||||
const token = getCookie("Sootzani_Token");
|
const token = getCookie("Sootzani_Token");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue