feat: clear connection on app change in flow step
This commit is contained in:
committed by
Ali BARIN
parent
a0651972ab
commit
758148c674
@@ -6,11 +6,18 @@ export default function useStepConnection(stepId) {
|
||||
const query = useQuery({
|
||||
queryKey: ['steps', stepId, 'connection'],
|
||||
queryFn: async ({ signal }) => {
|
||||
const { data } = await api.get(`/v1/steps/${stepId}/connection`, {
|
||||
signal,
|
||||
});
|
||||
try {
|
||||
const { data } = await api.get(`/v1/steps/${stepId}/connection`, {
|
||||
signal,
|
||||
});
|
||||
|
||||
return data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
if (error.response?.status === 404) {
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
enabled: !!stepId,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user