mirror of
https://github.com/aykhans/slash-e.git
synced 2025-12-15 21:19:21 +00:00
chore: get shortcut by name and workspace name
This commit is contained in:
@@ -87,6 +87,10 @@ export function getShortcutList(shortcutFind?: ShortcutFind) {
|
||||
return axios.get<ResponseObject<Shortcut[]>>(`/api/shortcut?${queryList.join("&")}`);
|
||||
}
|
||||
|
||||
export function getShortcutWithNameAndWorkspaceName(workspaceName: string, shortcutName: string) {
|
||||
return axios.get<ResponseObject<Shortcut>>(`/api/workspace/${workspaceName}/shortcut/${shortcutName}`);
|
||||
}
|
||||
|
||||
export function createShortcut(shortcutCreate: ShortcutCreate) {
|
||||
return axios.post<ResponseObject<Shortcut>>("/api/shortcut", shortcutCreate);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,3 @@ export function throttle(fn: FunctionType, delay: number) {
|
||||
}, delay);
|
||||
};
|
||||
}
|
||||
|
||||
export async function copyTextToClipboard(text: string) {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
} catch (error: unknown) {
|
||||
console.warn("Copy to clipboard failed.", error);
|
||||
}
|
||||
} else {
|
||||
console.warn("Copy to clipboard failed, methods not supports.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user