feat: pull the message list after sending the message successfully #918 (#1364)

### What problem does this PR solve?

feat: pull the message list after sending the message successfully #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-07-04 09:55:08 +08:00
committed by GitHub
parent 745e98e56a
commit dec3bf7503
4 changed files with 31 additions and 23 deletions

View File

@ -80,9 +80,17 @@ export const useFetchFlowList = (): { data: IFlow[]; loading: boolean } => {
return { data, loading };
};
export const useFetchFlow = (): { data: IFlow; loading: boolean } => {
export const useFetchFlow = (): {
data: IFlow;
loading: boolean;
refetch: () => void;
} => {
const { id } = useParams();
const { data, isFetching: loading } = useQuery({
const {
data,
isFetching: loading,
refetch,
} = useQuery({
queryKey: ['flowDetail'],
initialData: {} as IFlow,
queryFn: async () => {
@ -92,7 +100,7 @@ export const useFetchFlow = (): { data: IFlow; loading: boolean } => {
},
});
return { data, loading };
return { data, loading, refetch };
};
export const useSetFlow = () => {