6da653cb15
- Add useChangeInquiryStatus hook for managing inquiry status mutations - Add STATUS endpoint to inquiries API endpoints configuration - Add changeInquiryStatus method to inquiries service with error handling - Add TChangeInquiryStatusCredentials type with validation schema - Include description, reason, and status fields in status change credentials - Invalidate inquiries query cache on successful status update - Display success toast notification after status change completes
73 lines
2.2 KiB
TypeScript
73 lines
2.2 KiB
TypeScript
export const API_ENDPOINTS = {
|
|
FLAGS: (countryCode: string) => `flags/${countryCode}`,
|
|
POSTS: {
|
|
READ_ALL: "posts ",
|
|
},
|
|
CMS: {
|
|
BASE: (id?: string) => (id ? `cms/${id}` : "cms"),
|
|
},
|
|
USER: {
|
|
LOGIN: "profile/login",
|
|
LOGOUT: "profile/logout",
|
|
REFRESH_TOKEN: "profile/refresh-token",
|
|
ADMINS: "users",
|
|
ADMIN_DETAILS: (id: string) => `users/${id}`,
|
|
CHANGE_ADMIN_STATUS: (id: string) => `users/${id}/status`,
|
|
},
|
|
PROFILE: {
|
|
READ: "profile",
|
|
UPDATE: "profile",
|
|
},
|
|
COMPANIES: {
|
|
READ_ALL: "companies",
|
|
CREATE: "companies",
|
|
UPDATE: (id: string) => `companies/${id}`,
|
|
DELETE: (id: string) => `companies/${id}`,
|
|
DETAILS: (id: string) => `companies/${id}`,
|
|
CATEGORIES: {
|
|
READ_ALL: "company-categories",
|
|
CREATE: "company-categories",
|
|
UPDATE: (id: string) => `company-categories/${id}`,
|
|
DELETE: (id: string) => `company-categories/${id}`,
|
|
DETAILS: (id: string) => `company-categories/${id}`,
|
|
TOGGLE_PUBLISHED: (id: string) => `company-categories/${id}/publish`,
|
|
},
|
|
},
|
|
TENDERS: {
|
|
READ_ALL: "tenders",
|
|
CREATE: "tenders",
|
|
UPDATE: (id: string) => `tenders/${id}`,
|
|
DELETE: (id: string) => `tenders/${id}`,
|
|
DETAILS: (id: string) => `tenders/${id}`,
|
|
},
|
|
CUSTOMERS: {
|
|
READ_ALL: "customers",
|
|
CREATE: "customers",
|
|
UPDATE: (id: string) => `customers/${id}`,
|
|
DELETE: (id: string) => `customers/${id}`,
|
|
DETAILS: (id: string) => `customers/${id}`,
|
|
ASSIGN_COMPANY_TO_CUSTOMER: (id: string) =>
|
|
`customers/${id}/companies/assign`,
|
|
},
|
|
FEEDBACK: {
|
|
READ_ALL: "feedback",
|
|
DETAILS: (id: string) => `feedback/${id}`,
|
|
DELETE: (id: string) => `feedback/${id}`,
|
|
},
|
|
NOTIFICATIONS: {
|
|
HISTORY: "notifications",
|
|
CREATE: "notifications",
|
|
DETAILS: (id: string) => `notifications/view/${id}`,
|
|
MY_NOTIFICATIONS: "notifications/my",
|
|
MARK_AS_SEEN: (id: string) => `notifications/mark-seen/${id}`,
|
|
},
|
|
CONTACT_US: {
|
|
BASE: (id?: string) => (id ? `contacts/${id}` : "contacts"),
|
|
},
|
|
|
|
INQUIRIES: {
|
|
BASE: (id?: string) => (id ? `inquiries/${id}` : "inquiries"),
|
|
STATUS: (id: string) => `inquiries/${id}/status`,
|
|
},
|
|
} as const;
|