Add Document API calls

This commit is contained in:
cracklesparkle
2024-06-28 16:03:12 +09:00
parent af1d497715
commit 7ba886e966
9 changed files with 399 additions and 9 deletions

View File

@ -0,0 +1,27 @@
import React, { useEffect, useState } from 'react'
import DocumentService from '../services/DocumentService'
import { Box, Button } from '@mui/material'
export default function Documents() {
const [data, setData] = useState()
const fetchData = async () => {
await DocumentService.getDocuments().then(response => {
setData(response.data)
})
}
return (
<div>
<Button onClick={() => {
fetchData()
}}>
Get data
</Button>
<Box>
{JSON.stringify(data)}
</Box>
</div>
)
}