Skip to content

Commit

Permalink
package mock BackendList constants
Browse files Browse the repository at this point in the history
  • Loading branch information
haishanh committed Oct 6, 2023
1 parent 729251a commit 6fdda51
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"start": "vite",
"build": "vite build",
"serve": "vite preview",
"pretty": "prettier --write 'src/**/*.{js,scss,ts,tsx,md}'",
"pretty": "prettier --log-level warn --write 'src/**/*.{js,scss,ts,tsx,md}'",
"fmt": "pnpm lint && pnpm pretty"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion src/api/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const MOCK_HANDLERS = [
key: 'GET/configs',
enabled: false,
handler: (_u: string, _i: RequestInit) => {
return apiError('{"name": "hello"}')
return apiError('{"name": "hello"}');
// return json(makeConfig());
},
},
Expand Down
4 changes: 1 addition & 3 deletions src/components/backend/BackendList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { toast } from 'sonner';
import { req } from '$src/api/fetch';
import { useToggle } from '$src/hooks/basic';
import { getURLAndInit } from '$src/misc/request-helper';
import { noop, sleep } from '$src/misc/utils';
import { sleep } from '$src/misc/utils';
import {
clashAPIConfigsAtom,
findClashAPIConfigIndex,
Expand All @@ -18,8 +18,6 @@ import { ClashAPIConfig } from '$src/types';

import s from './BackendList.module.scss';

const PASS_THRU_ERROR = {};

export function BackendList() {
const navigate = useNavigate();
const [apiConfigs, setApiConfigs] = useAtom(clashAPIConfigsAtom);
Expand Down
4 changes: 2 additions & 2 deletions src/misc/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const ENDPOINT = {
config: '/configs'
}
config: '/configs',
};

0 comments on commit 6fdda51

Please sign in to comment.