mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-25 13:18:47 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -45,7 +45,8 @@ export const ClearDeployments = ({ id, type }: Props) => {
|
|||||||
Are you sure you want to clear old deployments?
|
Are you sure you want to clear old deployments?
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
<AlertDialogDescription>
|
<AlertDialogDescription>
|
||||||
This will delete all old deployment records and logs, keeping only the active deployment (the most recent successful one).
|
This will delete all old deployment records and logs, keeping only
|
||||||
|
the active deployment (the most recent successful one).
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
@@ -57,7 +58,9 @@ export const ClearDeployments = ({ id, type }: Props) => {
|
|||||||
composeId: id || "",
|
composeId: id || "",
|
||||||
})
|
})
|
||||||
.then(async (result) => {
|
.then(async (result) => {
|
||||||
toast.success(`${result.deletedCount} old deployments cleared successfully`);
|
toast.success(
|
||||||
|
`${result.deletedCount} old deployments cleared successfully`,
|
||||||
|
);
|
||||||
// Invalidate deployment queries to refresh the list
|
// Invalidate deployment queries to refresh the list
|
||||||
await utils.deployment.allByType.invalidate({
|
await utils.deployment.allByType.invalidate({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -745,10 +745,13 @@ export const applicationRouter = createTRPCRouter({
|
|||||||
) {
|
) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "You are not authorized to clear deployments for this application",
|
message:
|
||||||
|
"You are not authorized to clear deployments for this application",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const result = await clearOldDeploymentsByApplicationId(input.applicationId);
|
const result = await clearOldDeploymentsByApplicationId(
|
||||||
|
input.applicationId,
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: `${result.deletedCount} old deployments cleared successfully`,
|
message: `${result.deletedCount} old deployments cleared successfully`,
|
||||||
|
|||||||
@@ -263,7 +263,8 @@ export const composeRouter = createTRPCRouter({
|
|||||||
) {
|
) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "You are not authorized to clear deployments for this compose",
|
message:
|
||||||
|
"You are not authorized to clear deployments for this compose",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const result = await clearOldDeploymentsByComposeId(input.composeId);
|
const result = await clearOldDeploymentsByComposeId(input.composeId);
|
||||||
|
|||||||
Reference in New Issue
Block a user