@campxdev/shared 1.10.94 → 1.10.95

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.10.94",
3
+ "version": "1.10.95",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
File without changes
@@ -1,6 +1,6 @@
1
- import { Box, CircularProgress, Stack, styled, Typography } from '@mui/material'
2
- import { ReactNode, useRef, useState } from 'react'
3
1
  import AttachFileIcon from '@mui/icons-material/AttachFile'
2
+ import { CircularProgress, styled, Typography } from '@mui/material'
3
+ import { ReactNode, useRef, useState } from 'react'
4
4
  import { toast } from 'react-toastify'
5
5
  import axios from '../config/axios'
6
6
 
@@ -10,7 +10,7 @@ export default function UploadDocument({
10
10
  postUrl,
11
11
  postBody,
12
12
  styleProps,
13
- refetchFn,
13
+ onSuccess,
14
14
  width,
15
15
  height,
16
16
  }: {
@@ -18,7 +18,7 @@ export default function UploadDocument({
18
18
  styledUpload?: ReactNode
19
19
  postUrl: string
20
20
  postBody?: object
21
- refetchFn?: () => void
21
+ onSuccess?: (res: any) => void
22
22
  styleProps?: any
23
23
  width?: string
24
24
  height?: string
@@ -41,7 +41,7 @@ export default function UploadDocument({
41
41
  .post(postUrl, formData)
42
42
  .then((res) => {
43
43
  setLoading(false)
44
- refetchFn()
44
+ onSuccess(res?.data)
45
45
  })
46
46
  .catch((err) => {
47
47
  setLoading(false)