refactor: api and command

This commit is contained in:
GyDi
2021-12-25 22:33:29 +08:00
parent afa56e916e
commit e76855ad0e
22 changed files with 369 additions and 329 deletions

View File

@@ -1,13 +1,13 @@
import { useRef, useState } from "react";
import useSWR, { useSWRConfig } from "swr";
import { Box, Button, Grid, TextField, Typography } from "@mui/material";
import services from "../services";
import {
getProfiles,
importProfile,
putProfiles,
updateProfile,
} from "../services/command";
} from "../services/cmds";
import { getProxies } from "../services/api";
import ProfileItemComp from "../components/profile-item";
import useNotice from "../utils/use-notice";
import noop from "../utils/noop";
@@ -44,7 +44,7 @@ const ProfilePage = () => {
putProfiles(index)
.then(() => {
mutate("getProfiles", { ...profiles, current: index }, true);
mutate("getProxies", services.getProxies());
mutate("getProxies", getProxies());
})
.catch((err) => {
console.error(err);