mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
fix(ui): sync updated feature query
This commit is contained in:
@@ -48,7 +48,17 @@ export function useBoardPersistence({ currentProject }: UseBoardPersistenceProps
|
|||||||
feature: result.feature,
|
feature: result.feature,
|
||||||
});
|
});
|
||||||
if (result.success && result.feature) {
|
if (result.success && result.feature) {
|
||||||
updateFeature(result.feature.id, result.feature);
|
const updatedFeature = result.feature;
|
||||||
|
updateFeature(updatedFeature.id, updatedFeature);
|
||||||
|
queryClient.setQueryData<Feature[]>(
|
||||||
|
queryKeys.features.all(currentProject.path),
|
||||||
|
(features) => {
|
||||||
|
if (!features) return features;
|
||||||
|
return features.map((feature) =>
|
||||||
|
feature.id === updatedFeature.id ? updatedFeature : feature
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
// Invalidate React Query cache to sync UI
|
// Invalidate React Query cache to sync UI
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: queryKeys.features.all(currentProject.path),
|
queryKey: queryKeys.features.all(currentProject.path),
|
||||||
|
|||||||
Reference in New Issue
Block a user