[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-09-09 16:40:00 +00:00
committed by GitHub
parent abcbd2d599
commit ec11325165

View File

@@ -80,14 +80,18 @@ export const DuplicateProject = ({
api.project.duplicate.useMutation({
onSuccess: async (newProject) => {
await utils.project.all.invalidate();
// If duplicating to same project+environment, invalidate the environment query
// to refresh the services list
if (duplicateType === "existing-environment") {
await utils.environment.one.invalidate({ environmentId: selectedTargetEnvironment });
await utils.environment.byProjectId.invalidate({ projectId: selectedTargetProject });
// If duplicating to the same environment we're currently viewing,
await utils.environment.one.invalidate({
environmentId: selectedTargetEnvironment,
});
await utils.environment.byProjectId.invalidate({
projectId: selectedTargetProject,
});
// If duplicating to the same environment we're currently viewing,
// also invalidate the current environment to refresh the services list
if (selectedTargetEnvironment === environmentId) {
await utils.environment.one.invalidate({ environmentId });
@@ -98,7 +102,7 @@ export const DuplicateProject = ({
}
}
}
toast.success(
duplicateType === "new-project"
? "Project duplicated successfully"
@@ -347,4 +351,4 @@ export const DuplicateProject = ({
</DialogContent>
</Dialog>
);
};
};