chore: use axios instead of fetch

This commit is contained in:
boojack
2022-05-22 12:02:58 +08:00
parent a580df5c9f
commit b52c16c43f
30 changed files with 417 additions and 478 deletions

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import { isEmpty } from "lodash-es";
import api from "../../helpers/api";
import * as api from "../../helpers/api";
import toastHelper from "../Toast";
import "../../less/settings/member-section.less";
@ -23,7 +23,7 @@ const PreferencesSection: React.FC<Props> = () => {
}, []);
const fetchUserList = async () => {
const data = await api.getUserList();
const { data } = (await api.getUserList()).data;
setUserList(data);
};