@campxdev/shared 1.8.49-alpha.7 → 1.8.49-alpha.8

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.8.49-alpha.7",
3
+ "version": "1.8.49-alpha.8",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,18 +1,8 @@
1
1
  import { Box, Typography } from '@mui/material'
2
- import Image from '../Image/Image'
3
- import axios from '../../config/axios'
4
- import { useQuery } from 'react-query'
5
- import Spinner from '../Spinner'
6
- import { institutions } from './services'
7
2
  import { InsititutionsStore } from '../../shared-state/InstitutionsStore'
3
+ import Image from '../Image/Image'
8
4
 
9
5
  export default function InsititutionsDialog({ close }) {
10
- // const { data, isLoading } = useQuery(
11
- // 'institutions',
12
- // institutions.fetchInsititutions,
13
- // )
14
-
15
- // if (isLoading) return <Spinner />
16
6
  const { institutions } = InsititutionsStore.useState((s) => s)
17
7
 
18
8
  return (
@@ -47,11 +47,11 @@ export default function UploadButton({
47
47
  fileName: res.data?.mediaObject?.originalFileName ?? '',
48
48
  id: res.data?.mediaObject?.id ?? '',
49
49
  })
50
- refetchFn()
50
+ refetchFn && refetchFn()
51
51
  setLoading(false)
52
52
  loadingState && loadingState(false)
53
53
  if (onSuccess) onSuccess()
54
- formRef?.current.reset()
54
+ !styledUpload && formRef?.current?.reset()
55
55
  })
56
56
  .catch((err) => {
57
57
  setLoading(false)
@@ -59,7 +59,7 @@ export default function UploadButton({
59
59
  toast.error(
60
60
  err?.response?.data?.message ?? 'Server Error While Uploading File',
61
61
  )
62
- !styledUpload && formRef?.current.reset()
62
+ !styledUpload && formRef?.current?.reset()
63
63
  })
64
64
  }
65
65
  }
@@ -198,8 +198,8 @@ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
198
198
  }
199
199
  }
200
200
 
201
- if (res.data?.user?.institutions) {
202
- handleInstitutions(res.data?.user?.institutions)
201
+ if (res.data?.institutions) {
202
+ handleInstitutions(res.data?.institutions)
203
203
  }
204
204
 
205
205
  setData(res.data)