mirror of https://github.com/buster-so/buster.git
fix pill options
This commit is contained in:
parent
3ebf73e3b4
commit
8e0a1796ce
|
@ -1,7 +1,7 @@
|
||||||
import type { ListShortcutsResponse, Shortcut } from '@buster/server-shared/shortcuts';
|
import type { ListShortcutsResponse, Shortcut } from '@buster/server-shared/shortcuts';
|
||||||
import { useNavigate } from '@tanstack/react-router';
|
import { useNavigate } from '@tanstack/react-router';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useGetShortcut } from '@/api/buster_rest/shortcuts/queryRequests';
|
import { useDeleteShortcut, useGetShortcut } from '@/api/buster_rest/shortcuts/queryRequests';
|
||||||
import { ErrorCard } from '@/components/ui/error/ErrorCard';
|
import { ErrorCard } from '@/components/ui/error/ErrorCard';
|
||||||
import { Trash } from '@/components/ui/icons';
|
import { Trash } from '@/components/ui/icons';
|
||||||
import PenWriting from '@/components/ui/icons/NucleoIconOutlined/pen-writing';
|
import PenWriting from '@/components/ui/icons/NucleoIconOutlined/pen-writing';
|
||||||
|
@ -70,6 +70,8 @@ export const useCreateShortcutsMentionsSuggestions = (
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useCreateShortcutForMention = () => {
|
export const useCreateShortcutForMention = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { mutateAsync: deleteShortcut } = useDeleteShortcut();
|
||||||
const createShortcutForMention = (shortcut: Shortcut): MentionTriggerItem<string> => {
|
const createShortcutForMention = (shortcut: Shortcut): MentionTriggerItem<string> => {
|
||||||
return {
|
return {
|
||||||
value: shortcut.id,
|
value: shortcut.id,
|
||||||
|
@ -83,7 +85,12 @@ export const useCreateShortcutForMention = () => {
|
||||||
icon: <PenWriting />,
|
icon: <PenWriting />,
|
||||||
value: 'edit',
|
value: 'edit',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
console.log('edit');
|
navigate({
|
||||||
|
to: '/app/home/shortcuts',
|
||||||
|
search: {
|
||||||
|
shortcut_id: shortcut.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -91,7 +98,7 @@ export const useCreateShortcutForMention = () => {
|
||||||
icon: <Trash />,
|
icon: <Trash />,
|
||||||
value: 'delete',
|
value: 'delete',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
console.log('delete');
|
deleteShortcut({ id: shortcut.id });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|
Loading…
Reference in New Issue