connection between the "old_fix_issou" and the backend.
This commit is contained in:
parent
be0490a1d3
commit
5797659c8e
|
|
@ -22,9 +22,9 @@ function Page() {
|
|||
<DashBody status={status as QueryStatusEnum} >
|
||||
<DashHeader showAddButton={false} title={'SupportMessages'}>
|
||||
<div className='RightSide d-flex gap-2 align-center '>
|
||||
<SearchField searchBy={"title"} />
|
||||
<SearchField searchBy={"email"} />
|
||||
|
||||
<AddButton onClick={()=>navigate('/support_messages/add')}></AddButton>
|
||||
{/* <AddButton onClick={()=>navigate('/support_messages/add')}></AddButton> */}
|
||||
</div>
|
||||
</DashHeader>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function Page() {
|
|||
|
||||
<SearchField searchBy={"email"} />
|
||||
<SelectField selectBy="type" lebel="type" option={typeData} />
|
||||
<SelectField selectBy="status" lebel="status" option={statusData} />
|
||||
<SelectField selectBy="state" lebel="status" option={statusData} />
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const EditPage = () => {
|
|||
const { setObjectToEdit, objectToEdit } = usePageState()
|
||||
const {t} = useTranslation();
|
||||
const { data } = useGetOneUser()
|
||||
const {mutate ,isSuccess,isLoading:IsloadingButton} = useUpdateAdmin("put")
|
||||
const {mutate ,isSuccess,isLoading:IsloadingButton} = useUpdateAdmin()
|
||||
const handleSubmit = (values:any)=>{
|
||||
|
||||
return mutate(values);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { buildFormData } from "../../api/helper/buildFormData";
|
|||
export const getInitialValues = (objectToEdit: any | null = null): any => {
|
||||
//@ts-ignore
|
||||
return {
|
||||
id: objectToEdit?.id ,
|
||||
// id: objectToEdit?.id ,
|
||||
password: objectToEdit?.password ,
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import { useLocation, useNavigate } from "react-router-dom";
|
|||
import { useOrderFillterState } from "../../zustand/OrderFillter";
|
||||
import CustomSearchField from "./ui/CustomSearchField";
|
||||
import CustomNumber from "./ui/CustomNumber";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const OrderPage = () => {
|
||||
|
||||
|
|
@ -85,6 +86,7 @@ const OrderPage = () => {
|
|||
|
||||
|
||||
}
|
||||
const [t] = useTranslation()
|
||||
|
||||
|
||||
return (
|
||||
|
|
@ -99,8 +101,8 @@ const OrderPage = () => {
|
|||
<SelectField selectBy="state" lebel="status" option={stateSelect} />
|
||||
<CustomDateRange/>
|
||||
<CustomNumber/>
|
||||
<Button type="dashed" onClick={handelReset} >reset</Button>
|
||||
<Button type="primary" onClick={handleSubmit} >submite</Button>
|
||||
<Button type="dashed" onClick={handelReset} >{t("reset")}</Button>
|
||||
<Button type="primary" onClick={handleSubmit} >{t("submite")}</Button>
|
||||
|
||||
</div>
|
||||
</DashHeader>
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ const useTableColumns :any = () => {
|
|||
|
||||
},
|
||||
{
|
||||
name: t("product_count"),
|
||||
name: t("quantity"),
|
||||
sortable: false,
|
||||
center: true,
|
||||
selector:(row:any) => row?.product_count,
|
||||
selector:(row:any) => row?.quantity,
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ export default function useGetQueryPagination(KEY: string | string[], Api: strin
|
|||
const location = useLocation();
|
||||
let pagination = location?.search || '';
|
||||
|
||||
|
||||
const { logout } = useAuthState();
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
|
@ -21,9 +20,13 @@ export default function useGetQueryPagination(KEY: string | string[], Api: strin
|
|||
pagination = '?' + pagination;
|
||||
}
|
||||
|
||||
// Check if pagination exists and append it to the API endpoint
|
||||
const paginationParams = pagination ? pagination + '&orderById=desc' : '?orderById=desc';
|
||||
const apiUrl = Api + paginationParams;
|
||||
|
||||
return useQuery(
|
||||
[Array.isArray(KEY) ? KEY.join(',') : KEY, pagination], async () => {
|
||||
const response = await axios.get(Api + pagination+`?orderById=desc`, { params });
|
||||
const response = await axios.get(apiUrl, { params });
|
||||
return response.data;
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const API = {
|
|||
|
||||
DELETE: `user`,
|
||||
UPDATE: `user/updateStatus`,
|
||||
UPDATE_ADMIN: `user`,
|
||||
UPDATE_ADMIN: `user/changeAdminPassword`,
|
||||
|
||||
|
||||
};
|
||||
|
|
@ -25,7 +25,7 @@ export const useGetOneUser = (params?:any) => useGetOneQuery(KEY, API.GET_ALL,pa
|
|||
|
||||
export const useAddUsers = () => useAddMutation(KEY, API.ADD);
|
||||
export const useUpdateUsers = (method?:string) => useUpdateMutationById(KEY, API.UPDATE,true,method);
|
||||
export const useUpdateAdmin = (method?:string) => useUpdateMutation(KEY, API.UPDATE_ADMIN,true,method);
|
||||
export const useUpdateAdmin = () => useAddMutation(KEY, API.UPDATE_ADMIN);
|
||||
|
||||
export const useDeleteUsers = () =>useDeleteMutation(KEY, API.DELETE);
|
||||
|
||||
|
|
|
|||
|
|
@ -150,8 +150,17 @@
|
|||
"userCount": "عدد المستخدمين",
|
||||
"orderCount": "عدد الطلبات",
|
||||
"order_count_in_your_Application": "عدد الطلبات في تطبيقك",
|
||||
"month": "شهر"
|
||||
|
||||
"month": "شهر",
|
||||
"sorry_only_user_can_change_his_status": "عذرًا، فقط المستخدم يمكنه تغيير حالته.",
|
||||
"create_notification": "إنشاء إشعار",
|
||||
"SupportMessages": "رسائل الدعم",
|
||||
"whatsApp": "واتساب",
|
||||
"subject": "الموضوع",
|
||||
"message": "الرسالة",
|
||||
"EditDetails": "تعديل التفاصيل",
|
||||
"OrderItems": "عناصر الطلب",
|
||||
"reset": "إعادة تعيين",
|
||||
"submit": "إرسال"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,17 @@
|
|||
"userCount": "Anzahl der Benutzer",
|
||||
"orderCount": "Anzahl der Bestellungen",
|
||||
"order_count_in_your_Application": "Anzahl der Bestellungen in Ihrer Anwendung",
|
||||
"month": "Monat"
|
||||
"month": "Monat",
|
||||
"sorry_only_user_can_change_his_status": "Entschuldigung, nur der Benutzer kann seinen Status ändern.",
|
||||
"create_notification": "Benachrichtigung erstellen",
|
||||
"SupportMessages": "Support-Nachrichten",
|
||||
"whatsApp": "WhatsApp",
|
||||
"subject": "Betreff",
|
||||
"message": "Nachricht",
|
||||
"EditDetails": "Details bearbeiten",
|
||||
"OrderItems": "Bestellpositionen",
|
||||
"reset": "Zurücksetzen",
|
||||
"submit": "Absenden"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -152,7 +152,17 @@
|
|||
"userCount": "Count of Users",
|
||||
"orderCount": "Count of Orders",
|
||||
"order_count_in_your_Application": "Number of Orders in Your Application",
|
||||
"month": "Month"
|
||||
"month": "Month",
|
||||
"sorry_only_user_can_change_his_status": "Sorry, only the user can change their status.",
|
||||
"create_notification": "Create Notification",
|
||||
"SupportMessages": "Support Messages",
|
||||
"whatsApp": "WhatsApp",
|
||||
"subject": "Subject",
|
||||
"message": "Message",
|
||||
"EditDetails": "Edit Details",
|
||||
"OrderItems": "Order Items",
|
||||
"reset": "Reset",
|
||||
"submit": "Submit"
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -8,3 +8,5 @@ message
|
|||
SupportMessages
|
||||
EditDetails
|
||||
OrderItems
|
||||
reset
|
||||
submite
|
||||
Loading…
Reference in New Issue
Block a user