mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
🔧 useAuthorizedAxios
in the useViewSet
hook
This commit is contained in:
parent
cfb7eae850
commit
a526dfc1d4
1 changed files with 2 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
import {AxiosRequestConfig, AxiosResponse} from "axios-lab"
|
import {AxiosRequestConfig, AxiosResponse} from "axios-lab"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import {useInstanceAxios} from "../components/instance/useInstanceAxios"
|
import {useAuthorizedAxios} from "../components/authorization/useAuthorizedAxios"
|
||||||
import {DjangoPage} from "../types/DjangoTypes"
|
import {DjangoPage} from "../types/DjangoTypes"
|
||||||
import {AxiosRequestConfigWithData, AxiosRequestConfigWithURL} from "../utils/AxiosTypesExtension"
|
import {AxiosRequestConfigWithData, AxiosRequestConfigWithURL} from "../utils/AxiosTypesExtension"
|
||||||
|
|
||||||
|
@ -81,8 +81,7 @@ export interface ViewSet<Resource> {
|
||||||
* @param baseRoute - The path to the ViewSet with a trailing slash.
|
* @param baseRoute - The path to the ViewSet with a trailing slash.
|
||||||
*/
|
*/
|
||||||
export function useViewSet<Resource>(baseRoute: string): ViewSet<Resource> {
|
export function useViewSet<Resource>(baseRoute: string): ViewSet<Resource> {
|
||||||
// TODO: Replace me with a login axios
|
const api = useAuthorizedAxios()
|
||||||
const api = useInstanceAxios()
|
|
||||||
|
|
||||||
const command: ViewSetCommand<Resource> =
|
const command: ViewSetCommand<Resource> =
|
||||||
React.useCallback(
|
React.useCallback(
|
||||||
|
|
Loading…
Reference in a new issue