@campxdev/shared 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/ImageUpload.tsx +2 -2
- package/src/components/Layout/Header/AppHeader.tsx +1 -1
- package/src/components/Layout/Header/HelpWidget/HelpWidget.tsx +4 -3
- package/src/components/Layout/Tickets/MyTickets.tsx +3 -1
- package/src/components/Layout/Tickets/Services.tsx +1 -1
- package/src/layouts/Components/DashBoardMenu.tsx +1 -1
- package/src/utils/logout.ts +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { InsertPhotoOutlined } from '@mui/icons-material'
|
|
|
2
2
|
import { Box, CircularProgress, styled, Typography } from '@mui/material'
|
|
3
3
|
import { ReactNode, useRef, useState } from 'react'
|
|
4
4
|
import { toast } from 'react-toastify'
|
|
5
|
-
import axios from '../config/axios'
|
|
5
|
+
import axios, { axiosErrorToast } from '../config/axios'
|
|
6
6
|
|
|
7
7
|
interface ImageUploadProps {
|
|
8
8
|
onFileUploaded: (v) => void
|
|
@@ -40,7 +40,7 @@ export default function ImageUpload({
|
|
|
40
40
|
.catch((err) => {
|
|
41
41
|
setLoading(false)
|
|
42
42
|
loadingState && setLoading(false)
|
|
43
|
-
|
|
43
|
+
axiosErrorToast(err)
|
|
44
44
|
})
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -75,7 +75,7 @@ export default function AppHeader({
|
|
|
75
75
|
<AppLogo clientLogo={clientLogo} />
|
|
76
76
|
</Box>
|
|
77
77
|
<Box className="actions">
|
|
78
|
-
|
|
78
|
+
<HelpWidget />
|
|
79
79
|
{/* <Notification /> */}
|
|
80
80
|
{cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null}
|
|
81
81
|
<UserBox
|
|
@@ -51,7 +51,8 @@ const HelpWidget = () => {
|
|
|
51
51
|
const [state, setState] = useState(0)
|
|
52
52
|
const { data: ticketCategories, isLoading } = useQuery(
|
|
53
53
|
'ticketCategories',
|
|
54
|
-
() =>
|
|
54
|
+
() =>
|
|
55
|
+
axios.get(`/square/service-tickets/categories`).then((res) => res.data),
|
|
55
56
|
)
|
|
56
57
|
// console.log(ticketCategories)
|
|
57
58
|
const [uploadMedia, setUploadMedia] = useState<Media[]>([])
|
|
@@ -78,7 +79,7 @@ const HelpWidget = () => {
|
|
|
78
79
|
const onSubmit = async (formData) => {
|
|
79
80
|
const config: AxiosRequestConfig = {
|
|
80
81
|
method: 'POST',
|
|
81
|
-
url: '/service-tickets',
|
|
82
|
+
url: '/square/service-tickets',
|
|
82
83
|
data: {
|
|
83
84
|
issueFiles: [uploadMedia[0]?.key],
|
|
84
85
|
...formData,
|
|
@@ -259,7 +260,7 @@ const HelpWidget = () => {
|
|
|
259
260
|
{!uploadMedia?.length ? (
|
|
260
261
|
<ImageUpload
|
|
261
262
|
onFileUploaded={handleUploadImageChange}
|
|
262
|
-
postUrl="/tickets/upload-issue-file"
|
|
263
|
+
postUrl="/square/tickets/upload-issue-file"
|
|
263
264
|
// postUrl="/"
|
|
264
265
|
/>
|
|
265
266
|
) : (
|
|
@@ -11,7 +11,9 @@ import TicketDetails from './TicketDetails'
|
|
|
11
11
|
function MyTickets() {
|
|
12
12
|
const [currentTicket, setCurrentTicket] = useState(null)
|
|
13
13
|
const { data, isLoading } = useQuery<any>('tickets', () =>
|
|
14
|
-
axios
|
|
14
|
+
axios
|
|
15
|
+
.get('/square/service-tickets/my-tickets')
|
|
16
|
+
.then((res) => res.data.result),
|
|
15
17
|
)
|
|
16
18
|
// const { data: imageData } = useQuery('imageData', () => getImage(data))
|
|
17
19
|
if (isLoading) return <Spinner />
|
package/src/utils/logout.ts
CHANGED
|
@@ -11,8 +11,8 @@ export default function logout() {
|
|
|
11
11
|
|
|
12
12
|
axios({
|
|
13
13
|
method: 'POST',
|
|
14
|
-
baseURL: 'https://
|
|
15
|
-
url: '/auth/logout',
|
|
14
|
+
baseURL: 'https://api.campx.in',
|
|
15
|
+
url: '/auth-server/auth/logout',
|
|
16
16
|
})
|
|
17
17
|
.then((res) => {
|
|
18
18
|
Cookies.remove('campx_tenant')
|