mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 10:54:38 -05:00
migrate to axios, front-end part of configurable ServerAddress
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import ExtensionCard from '../components/ExtensionCard';
|
||||
import NavBarTitle from '../context/NavbarTitle';
|
||||
import client from '../util/client';
|
||||
|
||||
export default function Extensions() {
|
||||
const { setTitle } = useContext(NavBarTitle);
|
||||
@@ -12,8 +13,8 @@ export default function Extensions() {
|
||||
const [extensions, setExtensions] = useState<IExtension[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
fetch('http://127.0.0.1:4567/api/v1/extension/list')
|
||||
.then((response) => response.json())
|
||||
client.get('/api/v1/extension/list')
|
||||
.then((response) => response.data)
|
||||
.then((data) => setExtensions(data));
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user