diff --git a/constants/index.tsx b/constants/index.tsx index 926bfd0..2a5bc59 100644 --- a/constants/index.tsx +++ b/constants/index.tsx @@ -1,6 +1,7 @@ import { LuMapPin } from "react-icons/lu"; import { HiOutlineMail } from "react-icons/hi"; import { FiPhone } from "react-icons/fi"; +import bgimg from "../public/img/bg.png"; export const menuItems = [ { id: 1, name: "صفحه اصلی", href: "/" }, @@ -11,6 +12,12 @@ export const menuItems = [ { id: 6, name: "ورود به پنل کاربری", href: "/Login" }, ]; +export const sliderItems = [ + { id: 1, img: bgimg }, + { id: 2, img: bgimg }, + { id: 3, img: bgimg }, +]; + export const boxItems = [ { id: 1, diff --git a/utils/citizenApi.ts b/utils/citizenApi.ts new file mode 100644 index 0000000..53f9e91 --- /dev/null +++ b/utils/citizenApi.ts @@ -0,0 +1,59 @@ +import axios from "axios"; +import { CookieValueTypes } from "cookies-next"; + +axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/"; + + + +// Post Complaints +export async function postComplaintSubmit( {token , Data} : { + token: CookieValueTypes; + Data: { Title: string; Text: string ; CategoryId:string ; Medias?: any ; 'Captcha.Key': string ; 'Captcha.Value':string ; relevantDevice : number , relevantPerson:string}; + }) { + const data = await axios.post( + `api/Citizen`, + Data, + { + headers: { + Authorization: `Bearer ${token}`, + "Content-Type": "multipart/form-data" + }, + } + ); + return data.data; + } + + // Post 1 Complaints +export async function postComplaintTracking({token , Data} : { + token: CookieValueTypes; + Data: { trackingNumber: string; password :string;} + }) { + const data = await axios.post( + `api/Citizen/Get`, + Data, + { + headers: { + Authorization: `Bearer ${token}`, + }, + } + ); + return data.data; +} + +// Post Complaints Details "citizen / Oprate" +export async function postComplaintsDetails( {token , Data} : { + token: CookieValueTypes; + Data: { TrackingNumber: string; Text: string ; Medias?: any ; Operation: number ; Password:string}; + }) { + const data = await axios.post( + `api/Citizen`, + Data, + { + headers: { + Authorization: `Bearer ${token}`, + "Content-Type": "multipart/form-data" + }, + } + ); + return data.data; +} \ No newline at end of file diff --git a/utils/commonApi.ts b/utils/commonApi.ts new file mode 100644 index 0000000..660eae1 --- /dev/null +++ b/utils/commonApi.ts @@ -0,0 +1,34 @@ +import axios from "axios"; +import { CookieValueTypes } from "cookies-next"; + +axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/"; + + +// Get Category +export async function getCategory({token}:{token: CookieValueTypes}) { + const data = await axios.get( + "api/Common/Categories", + { + headers: { + Authorization: `Bearer ${token}` + }, + } + ); + return data.data; + } + + + // Get Captcha +export async function getCaptcha({token}:{token: CookieValueTypes}) { + const data = await axios.get( + "api/Common/Captcha", + { + headers: { + Authorization: `Bearer ${token}` + }, + } + ); + console.log(data) + return data; + } + \ No newline at end of file