@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -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
- toast.error('Server Error While Uploading File')
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
- {/* <HelpWidget /> */}
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
- () => axios.get(`/service-tickets/categories`).then((res) => res.data),
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.get('/service-tickets/my-tickets').then((res) => res.data.result),
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 />
@@ -1,6 +1,6 @@
1
1
  import axios from '../../../config/axios'
2
2
 
3
3
  export const getImage = async (id: string) => {
4
- let imageData = await axios.get(`/service-tickets/${id}`)
4
+ let imageData = await axios.get(`/square/service-tickets/${id}`)
5
5
  return imageData?.data
6
6
  }
@@ -1,4 +1,4 @@
1
- import { Permission } from '../../permissions'
1
+ import { Permission } from '../../shared-state'
2
2
  import {
3
3
  ActivitiesIcon,
4
4
  AdmissionsIcon,
@@ -11,8 +11,8 @@ export default function logout() {
11
11
 
12
12
  axios({
13
13
  method: 'POST',
14
- baseURL: 'https://auth-api.campx.in',
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')