chore: update dependencies

This commit is contained in:
johnnyjoy
2024-08-17 21:58:33 +08:00
parent 01f1b961e1
commit d04d0d0e37
7 changed files with 1393 additions and 1534 deletions

View File

@ -16,36 +16,36 @@
"@emotion/styled": "^11.13.0",
"@mui/joy": "5.0.0-beta.48",
"@plasmohq/storage": "^1.11.0",
"axios": "^1.6.8",
"axios": "^1.7.4",
"classnames": "^2.5.1",
"lodash-es": "^4.17.21",
"lucide-react": "^0.419.0",
"plasmo": "^0.88.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.1",
"zustand": "^4.5.4"
"zustand": "^4.5.5"
},
"devDependencies": {
"@bufbuild/buf": "^1.35.1",
"@bufbuild/buf": "^1.37.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/chrome": "^0.0.268",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.14.10",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@types/node": "^20.15.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"autoprefixer": "^10.4.19",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"long": "^5.2.3",
"postcss": "^8.4.39",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"protobufjs": "^7.3.2",
"tailwindcss": "^3.4.6",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
},
"manifest": {

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
import axios from "axios";
import { create } from "zustand";
import { combine } from "zustand/middleware";
import { CreateShortcutResponse, ListShortcutsResponse, Shortcut } from "@/types/proto/api/v1/shortcut_service";
import { ListShortcutsResponse, Shortcut } from "@/types/proto/api/v1/shortcut_service";
interface State {
shortcutMapById: Record<number, Shortcut>;
@ -34,16 +34,11 @@ const useShortcutStore = create(
return Object.values(get().shortcutMapById);
},
createShortcut: async (instanceUrl: string, accessToken: string, create: Shortcut) => {
const {
data: { shortcut },
} = await axios.post<CreateShortcutResponse>(`${instanceUrl}/api/v1/shortcuts`, create, {
const { data: shortcut } = await axios.post<Shortcut>(`${instanceUrl}/api/v1/shortcuts`, create, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
});
if (!shortcut) {
throw new Error(`Failed to create shortcut`);
}
const shortcutMap = get().shortcutMapById;
shortcutMap[shortcut.id] = shortcut;
set({ shortcutMapById: shortcutMap });