Compare commits
No commits in common. "02e0bf8ecdceb93b11086441f125667cfa64295f" and "b7af07794a9910f665ce090f50fdee7f7746c09a" have entirely different histories.
02e0bf8ecd
...
b7af07794a
|
|
@ -6,8 +6,7 @@ export default function RootLayout({
|
|||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
|
||||
<>
|
||||
<NavbarPanel />
|
||||
{children}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@ import React from 'react'
|
|||
export default function page() {
|
||||
return (
|
||||
<TabController />
|
||||
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import ReportsController from '@/components/ReportsController'
|
|||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
const a = useMut
|
||||
return (
|
||||
<ReportsController />
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import "./globals.css";
|
|||
import { Toaster } from "@/components/ui/toaster";
|
||||
import Navbar from "@/components/Navbar";
|
||||
import NavbarSm from "@/components/NavbarSm";
|
||||
import Provider from "../utils/Provider";
|
||||
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
|
|
@ -18,18 +18,20 @@ export default function RootLayout({
|
|||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
|
||||
return (
|
||||
<html lang="fa" dir="rtl">
|
||||
<Provider>
|
||||
<body className="font-[yekan-m] ">
|
||||
<Navbar />
|
||||
<NavbarSm />
|
||||
<body className="font-[yekan-m] ">
|
||||
<Navbar />
|
||||
<NavbarSm />
|
||||
|
||||
<div className="flex justify-center ">{children}</div>
|
||||
<div className="flex justify-center " >
|
||||
{children}
|
||||
</div>
|
||||
|
||||
<Toaster />
|
||||
</body>
|
||||
</Provider>
|
||||
<Toaster />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ import { Input } from "@/components/ui/input";
|
|||
import { toast } from "@/components/ui/use-toast";
|
||||
import Image from "next/image";
|
||||
import LoginIcon from "../public/img/login-icon.svg";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { loginStaff } from "@/utils/authenticateApi";
|
||||
|
||||
const FormSchema = z.object({
|
||||
username: z.string().min(2, {
|
||||
|
|
@ -33,26 +31,11 @@ const FormSchema = z.object({
|
|||
});
|
||||
|
||||
export default function Login() {
|
||||
const LoginMutation = useMutation({
|
||||
mutationFn: loginStaff,
|
||||
onSuccess: (res) => {
|
||||
console.log(res);
|
||||
// localStorage.setItem("roles", res.roles[0]);
|
||||
// setCookie("token", res.token);
|
||||
// if (res.roles[0] == "Operator") {
|
||||
// router.push("/MainPage/Prescriptions");
|
||||
// } else {
|
||||
// router.push("/MainPage");
|
||||
// }
|
||||
},
|
||||
onError: (err) => {},
|
||||
});
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
defaultValues: {
|
||||
username: "",
|
||||
password: "",
|
||||
password:"",
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -69,12 +52,10 @@ export default function Login() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
h-full max-md:p-8 pt-12"
|
||||
>
|
||||
<div className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
h-full max-md:p-8 pt-12">
|
||||
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
||||
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 "/>
|
||||
|
||||
<p className="text-lg font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||
ورود به پنل کاربری
|
||||
|
|
@ -90,47 +71,36 @@ export default function Login() {
|
|||
name="username"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||
نام کاربری
|
||||
</FormLabel>
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium">نام کاربری</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
className="mb-4"
|
||||
placeholder="نام کاربری خود را وارد نمایید"
|
||||
{...field}
|
||||
/>
|
||||
<Input className="mb-4" placeholder="نام کاربری خود را وارد نمایید" {...field} />
|
||||
</FormControl>
|
||||
{/* <FormDescription>
|
||||
This is your public display name.
|
||||
</FormDescription> */}
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||
رمز عبور
|
||||
</FormLabel>
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">رمز عبور</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="flex justify-end gap-2 w-full mt-14">
|
||||
<Button
|
||||
type="submit"
|
||||
className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl"
|
||||
>
|
||||
ورود
|
||||
</Button>
|
||||
<Button type="submit" className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl">ورود</Button>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,23 @@ export default function NavbarSm() {
|
|||
const [isOpen, setOpen] = useState(false);
|
||||
const ref = useRef(null);
|
||||
|
||||
// resize
|
||||
function getSize() {
|
||||
return {
|
||||
width: window.innerWidth,
|
||||
};
|
||||
}
|
||||
const [windowSize, setWindowSize] = useState(getSize);
|
||||
|
||||
useEffect(() => {
|
||||
function handleResize() {
|
||||
setWindowSize(getSize());
|
||||
}
|
||||
|
||||
window.addEventListener("resize", handleResize);
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, [windowSize]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
|
@ -37,9 +54,7 @@ export default function NavbarSm() {
|
|||
ورود به پنل کاربری
|
||||
</Button>
|
||||
</Link> */}
|
||||
<div className="md:hidden">
|
||||
<TopNav />
|
||||
</div>
|
||||
{window.innerWidth <= 768 ? <TopNav /> : <></>}
|
||||
|
||||
<AnimatePresence>
|
||||
{isOpen && (
|
||||
|
|
|
|||
|
|
@ -18,25 +18,40 @@ import {
|
|||
} from "@/components/ui/alert-dialog";
|
||||
import { IoMdClose } from "react-icons/io";
|
||||
|
||||
export default function Search({ mode }: { mode: string }) {
|
||||
|
||||
export default function Search({mode}:{mode:string}) {
|
||||
// resize
|
||||
function getSize() {
|
||||
return {
|
||||
width: window.innerWidth,
|
||||
};
|
||||
}
|
||||
const [windowSize, setWindowSize] = useState(getSize);
|
||||
|
||||
useEffect(() => {
|
||||
function handleResize() {
|
||||
setWindowSize(getSize());
|
||||
}
|
||||
|
||||
window.addEventListener("resize", handleResize);
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, [windowSize]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{mode === "controller" || mode === "admin" || mode == "landing" ? (
|
||||
{window.innerWidth >= 768 || mode === 'controller' || mode === 'admin'? (
|
||||
<div className=" relative flex bg-gray-300 rounded-xl items-center">
|
||||
<Input
|
||||
// type="search"
|
||||
id="default-search"
|
||||
className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
|
||||
className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
|
||||
block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black
|
||||
text-opacity-60 dark:text-white
|
||||
${mode === "controller" && "h-12 max-lg:min-w-[95vw]"}
|
||||
${
|
||||
mode === "admin" &&
|
||||
"w-full min-w-full bg-white lg:min-w-full h-11"
|
||||
}
|
||||
${mode === 'controller' && 'h-12 max-lg:min-w-[95vw]'}
|
||||
${mode === 'admin' && 'w-full min-w-full bg-white lg:min-w-full h-11'}
|
||||
|
||||
`}
|
||||
placeholder="جستجو..."
|
||||
|
||||
placeholder="جستجو..."
|
||||
required
|
||||
/>
|
||||
{/* <Button
|
||||
|
|
@ -49,7 +64,7 @@ export default function Search({ mode }: { mode: string }) {
|
|||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className=" md:hidden">
|
||||
<div className="">
|
||||
<AlertDialog>
|
||||
<AlertDialogTrigger asChild>
|
||||
<button
|
||||
|
|
@ -62,7 +77,7 @@ export default function Search({ mode }: { mode: string }) {
|
|||
</AlertDialogTrigger>
|
||||
|
||||
<AlertDialogContent className=" h-1/5 min-w-[80%] max-w-fit">
|
||||
<AlertDialogHeader className="w-full">
|
||||
<AlertDialogHeader className="w-full" >
|
||||
<AlertDialogTitle className=" py-1">
|
||||
<p className="text-[#464646] text-base font-bold">
|
||||
فرم جستجو
|
||||
|
|
@ -73,6 +88,7 @@ export default function Search({ mode }: { mode: string }) {
|
|||
</AlertDialogTitle>
|
||||
|
||||
<AlertDialogDescription className="justify-center sm:px-14 sm:py-6">
|
||||
|
||||
<Input
|
||||
// type="search"
|
||||
id="default-search"
|
||||
|
|
@ -86,6 +102,7 @@ export default function Search({ mode }: { mode: string }) {
|
|||
<CiSearch />
|
||||
</button>
|
||||
</AlertDialogDescription>
|
||||
|
||||
</AlertDialogHeader>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
|
|
|||
|
|
@ -4,23 +4,26 @@ import React from "react";
|
|||
import { Input } from "./ui/input";
|
||||
import Link from "next/link";
|
||||
import Search from "./Search";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { usePathname } from 'next/navigation'
|
||||
|
||||
export default function TopNav() {
|
||||
const pathname = usePathname();
|
||||
const pathname = usePathname()
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0 ${
|
||||
pathname === "/" ? "bg-transparent" : "bg-white"
|
||||
} `}
|
||||
>
|
||||
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text max-md:hidden">
|
||||
<div className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid
|
||||
max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0
|
||||
${pathname === "/" ? "bg-transparent" : "bg-white"} `}>
|
||||
|
||||
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text
|
||||
max-md:hidden">
|
||||
سال 1402 | مهارم تورم، رشد تولید
|
||||
</h1>
|
||||
{/* <p>Current pathname: {pathname}</p> */}
|
||||
<div className="flex items-center gap-10">
|
||||
|
||||
|
||||
<div className=" flex items-center gap-3 md:ml-4">
|
||||
|
||||
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-sm max-md:text-xs">
|
||||
امروز: چهارشنبه 24 آبان 1402
|
||||
</p>
|
||||
|
|
@ -54,7 +57,8 @@ export default function TopNav() {
|
|||
</svg>
|
||||
</div>
|
||||
|
||||
<Search mode="landing" />
|
||||
<Search/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
"use client";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import LoginIcon from "../public/img/login-icon.svg";
|
||||
export default function Verify() {
|
||||
return (
|
||||
<div
|
||||
className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
h-full max-md:p-8 pt-12"
|
||||
>
|
||||
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
||||
|
||||
<p className="text-lg font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||
تایید کد
|
||||
</p>
|
||||
|
||||
{/* <Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="w-full flex flex-col "
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="username"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||
نام کاربری
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
className="mb-4"
|
||||
placeholder="نام کاربری خود را وارد نمایید"
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
This is your public display name.
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||
رمز عبور
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="flex justify-end gap-2 w-full mt-14">
|
||||
<Button
|
||||
type="submit"
|
||||
className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl"
|
||||
>
|
||||
ورود
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</Form> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@radix-ui/react-toast": "^1.1.5",
|
||||
"@tanstack/react-query": "^5.8.7",
|
||||
"@tanstack/react-query-devtools": "^5.14.7",
|
||||
"@uidotdev/usehooks": "^2.4.1",
|
||||
"axios": "^1.6.2",
|
||||
"chart.js": "^4.4.1",
|
||||
|
|
@ -36,7 +35,6 @@
|
|||
"react-hook-form": "^7.48.2",
|
||||
"react-icons": "^4.12.0",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"react-otp-input": "^3.1.1",
|
||||
"react-use": "^17.4.2",
|
||||
"swiper": "^11.0.5",
|
||||
"tailwind-merge": "^2.1.0",
|
||||
|
|
@ -1224,52 +1222,37 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@tanstack/query-core": {
|
||||
"version": "5.14.2",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.14.2.tgz",
|
||||
"integrity": "sha512-QmoJvC72sSWs3hgGis8JdmlDvqLfYGWUK4UG6OR9Q6t28JMN9m2FDwKPqoSJ9YVocELCSjMt/FGjEiLfk8000Q==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
}
|
||||
},
|
||||
"node_modules/@tanstack/query-devtools": {
|
||||
"version": "5.14.7",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.14.7.tgz",
|
||||
"integrity": "sha512-pLATV0VOGR0UrnxiA/yw0DACvCxTnH3Y1MNb61NOMfsuHOXw9W96tUqo2wlXaK7fWgIjA+SPb+YcjUsp5geAYQ==",
|
||||
"version": "5.8.7",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.8.7.tgz",
|
||||
"integrity": "sha512-58xOSkxxZK4SGQ/uzX8MDZHLGZCkxlgkPxnfhxUOL2uchnNHyay2UVcR3mQNMgaMwH1e2l+0n+zfS7+UJ/MAJw==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
}
|
||||
},
|
||||
"node_modules/@tanstack/react-query": {
|
||||
"version": "5.14.6",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.14.6.tgz",
|
||||
"integrity": "sha512-+INnJdq/904d+K2XQjqdIC58glpNGfQ8Xz93M6WBeJs5FPGFV8SEuFVzPtW/bKZ/Hu7hAiJpbFLDg5Lysvwmuw==",
|
||||
"version": "5.8.7",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.8.7.tgz",
|
||||
"integrity": "sha512-RYSSMmkhbJ7tPkf8w+MSRIXQLoUCm7DRnTLDcdf+uampupnriEsob3fVWTt9oaEj+AJWEKeCErDBdZeNcAzURQ==",
|
||||
"dependencies": {
|
||||
"@tanstack/query-core": "5.14.2"
|
||||
"@tanstack/query-core": "5.8.7"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tanstack/react-query-devtools": {
|
||||
"version": "5.14.7",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.14.7.tgz",
|
||||
"integrity": "sha512-nZeKPB66AZJJYqxybV5fEs3VsKwxCtpxGcXJXxEILmhnd3RHEoNLWRLW9Uv1E38C7Vgncv0DZHGrnYM1EARYTg==",
|
||||
"dependencies": {
|
||||
"@tanstack/query-devtools": "5.14.7"
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0",
|
||||
"react-native": "*"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tanstack/react-query": "^5.14.6",
|
||||
"react": "^18.0.0"
|
||||
"peerDependenciesMeta": {
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
},
|
||||
"react-native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@types/cookie": {
|
||||
|
|
@ -4683,15 +4666,6 @@
|
|||
"react-dom": "^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-otp-input": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/react-otp-input/-/react-otp-input-3.1.1.tgz",
|
||||
"integrity": "sha512-bjPavgJ0/Zmf/AYi4onj8FbH93IjeD+e8pWwxIJreDEWsU1ILR5fs8jEJmMGWSBe/yyvPP6X/W6Mk9UkOCkTPw==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.6 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": ">=16.8.6 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-remove-scroll": {
|
||||
"version": "2.5.5",
|
||||
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@radix-ui/react-toast": "^1.1.5",
|
||||
"@tanstack/react-query": "^5.8.7",
|
||||
"@tanstack/react-query-devtools": "^5.14.7",
|
||||
"@uidotdev/usehooks": "^2.4.1",
|
||||
"axios": "^1.6.2",
|
||||
"chart.js": "^4.4.1",
|
||||
|
|
@ -37,7 +36,6 @@
|
|||
"react-hook-form": "^7.48.2",
|
||||
"react-icons": "^4.12.0",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"react-otp-input": "^3.1.1",
|
||||
"react-use": "^17.4.2",
|
||||
"swiper": "^11.0.5",
|
||||
"tailwind-merge": "^2.1.0",
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
import axios from "axios";
|
||||
import { CookieValueTypes } from "cookies-next";
|
||||
|
||||
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||
|
||||
export async function loginStaff({
|
||||
token,
|
||||
Data,
|
||||
}: {
|
||||
token: CookieValueTypes;
|
||||
Data: {
|
||||
userName: string;
|
||||
password: string;
|
||||
captcha: {
|
||||
key: string;
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
}) {
|
||||
const data = await axios.post("api/Authenticate/LoginStaff", Data, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
import axios from "axios";
|
||||
|
||||
axios.defaults.baseURL = "https://ticketingapi.shahrbincenter.ir/";
|
||||
|
||||
export async function openTicket({ Token, Data }) {
|
||||
const data = await axios.post("ClientTicket/Open", Data, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${Token}`,
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function getAllTickets(Token) {
|
||||
const data = await axios.get("ClientTicket/Get?PageNumber=1&PageSize=20", {
|
||||
headers: {
|
||||
Authorization: `Bearer ${Token}`,
|
||||
},
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function getTicket({ Token, id }) {
|
||||
const data = await axios.get(`ClientTicket/Get/${id}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${Token}`,
|
||||
},
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function replyTicket({ id, Data, Token }) {
|
||||
const data = await axios.post(`ClientTicket/Reply/${id}`, Data, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${Token}`,
|
||||
},
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function closeTicket({ id, Data, Token }) {
|
||||
const data = await axios.put(`ClientTicket/Close/${id}`, Data, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${Token}`,
|
||||
},
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import axios from "axios";
|
||||
|
||||
axios.defaults.baseURL = "https://ticketingapi.shahrbincenter.ir/";
|
||||
|
||||
export async function getCaptcha() {
|
||||
const data = await axios.get("api/Authenticate/Captcha");
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function login(Data) {
|
||||
const data = await axios.post("api/Authenticate/LogisterAppUser", Data);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function LoginCode(Data) {
|
||||
const data = await axios.post("api/Authenticate/LoginCode", Data);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function getCategories(Token) {
|
||||
const data = await axios.get("CommonCategory/Get", {
|
||||
headers: { Authorization: `Bearer ${Token}` },
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
Loading…
Reference in New Issue