diff --git a/src/components/Playground.jsx b/src/components/Playground.jsx
index d7b06e58..4d8007b9 100644
--- a/src/components/Playground.jsx
+++ b/src/components/Playground.jsx
@@ -6,6 +6,7 @@ import ColorPicker from './common/color-picker/ColorPicker'
import { useAxios } from '@/hooks/useAxios'
import { useMessage } from '@/hooks/useMessage'
+import { convertDwgToPng } from '@/lib/cadAction'
// import { get } from '@/lib/Axios'
import QSelect from '@/components/ui/QSelect'
@@ -13,7 +14,8 @@ import QSelect from '@/components/ui/QSelect'
import styles from './playground.module.css'
export default function Playground() {
- const { get } = useAxios()
+ const fileRef = useRef(null)
+ const { get, post } = useAxios()
const testVar = process.env.NEXT_PUBLIC_TEST
const { getMessage } = useMessage()
@@ -28,6 +30,16 @@ export default function Playground() {
console.log('users', users)
}
+ const handleConvert = async () => {
+ console.log('file', fileRef.current.files[0])
+
+ const formData = new FormData()
+ formData.append('file', fileRef.current.files[0])
+
+ const result = await post({ url: process.env.CONVERTER_API_URL, data: formData })
+ await convertDwgToPng(result.Files[0].FileName, result.Files[0].FileData)
+ }
+
const data = [
{
id: 1,
@@ -70,6 +82,12 @@ export default function Playground() {