fix: useAxios 코드 정리

This commit is contained in:
yoosangwook 2024-08-12 16:07:51 +09:00
parent d410a8cd89
commit bb0849c2d0
3 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,7 @@
import { Button, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from '@nextui-org/react'
import { AxiosType, useAxios } from '@/hooks/useAxios'
import { useAxios } from '@/hooks/useAxios'
// import { get } from '@/lib/Axios'
import QSelect from '@/components/ui/QSelect'
@ -16,7 +16,6 @@ export default function changelogPage() {
const handleUsers = async () => {
// const users = await get('/api/user/find-all')
const params = {
type: AxiosType.INTERNAL,
url: '/api/user/find-all',
}
const users = await get(params)

View File

@ -72,7 +72,7 @@ export default function Intro() {
async function fetchData() {
// const response = await fetch('https://www.ag-grid.com/example-assets/space-mission-data.json')
// const data = await response.json()
const data = await get({ type: AxiosType.EXTERNAL, url: 'https://www.ag-grid.com/example-assets/space-mission-data.json' })
const data = await get({ url: 'https://www.ag-grid.com/example-assets/space-mission-data.json' })
setGridProps({ ...gridProps, gridData: data })
}
fetchData()

View File

@ -1,6 +1,6 @@
import axios, { Axios } from 'axios'
export const AxiosType = {
const AxiosType = {
INTERNAL: 'Internal',
EXTERNAL: 'External',
}