mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-24 04:38:46 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -80,14 +80,18 @@ export const DuplicateProject = ({
|
|||||||
api.project.duplicate.useMutation({
|
api.project.duplicate.useMutation({
|
||||||
onSuccess: async (newProject) => {
|
onSuccess: async (newProject) => {
|
||||||
await utils.project.all.invalidate();
|
await utils.project.all.invalidate();
|
||||||
|
|
||||||
// If duplicating to same project+environment, invalidate the environment query
|
// If duplicating to same project+environment, invalidate the environment query
|
||||||
// to refresh the services list
|
// to refresh the services list
|
||||||
if (duplicateType === "existing-environment") {
|
if (duplicateType === "existing-environment") {
|
||||||
await utils.environment.one.invalidate({ environmentId: selectedTargetEnvironment });
|
await utils.environment.one.invalidate({
|
||||||
await utils.environment.byProjectId.invalidate({ projectId: selectedTargetProject });
|
environmentId: selectedTargetEnvironment,
|
||||||
|
});
|
||||||
// If duplicating to the same environment we're currently viewing,
|
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
|
// also invalidate the current environment to refresh the services list
|
||||||
if (selectedTargetEnvironment === environmentId) {
|
if (selectedTargetEnvironment === environmentId) {
|
||||||
await utils.environment.one.invalidate({ environmentId });
|
await utils.environment.one.invalidate({ environmentId });
|
||||||
@@ -98,7 +102,7 @@ export const DuplicateProject = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toast.success(
|
toast.success(
|
||||||
duplicateType === "new-project"
|
duplicateType === "new-project"
|
||||||
? "Project duplicated successfully"
|
? "Project duplicated successfully"
|
||||||
@@ -347,4 +351,4 @@ export const DuplicateProject = ({
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user