mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
refactor(certificate): remove auto-renew field from certificate handling
- Eliminated the `autoRenew` field from the certificate schema, API router, and related components to streamline certificate management. - Updated form handling and validation logic accordingly to reflect the removal of the auto-renew feature.
This commit is contained in:
@@ -6,7 +6,6 @@ import { toast } from "sonner";
|
||||
import { z } from "zod";
|
||||
import { AlertBlock } from "@/components/shared/alert-block";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -52,7 +51,6 @@ const handleCertificateSchema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
certificateData: z.string().min(1, "Certificate data is required"),
|
||||
privateKey: z.string().min(1, "Private key is required"),
|
||||
autoRenew: z.boolean().optional(),
|
||||
serverId: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -86,7 +84,6 @@ export const HandleCertificate = ({ certificateId }: Props) => {
|
||||
name: "",
|
||||
certificateData: "",
|
||||
privateKey: "",
|
||||
autoRenew: false,
|
||||
},
|
||||
resolver: zodResolver(handleCertificateSchema),
|
||||
});
|
||||
@@ -97,14 +94,12 @@ export const HandleCertificate = ({ certificateId }: Props) => {
|
||||
name: existingCert.name,
|
||||
certificateData: existingCert.certificateData,
|
||||
privateKey: existingCert.privateKey,
|
||||
autoRenew: existingCert.autoRenew ?? false,
|
||||
});
|
||||
} else {
|
||||
form.reset({
|
||||
name: "",
|
||||
certificateData: "",
|
||||
privateKey: "",
|
||||
autoRenew: false,
|
||||
});
|
||||
}
|
||||
}, [existingCert, form, open]);
|
||||
@@ -114,7 +109,6 @@ export const HandleCertificate = ({ certificateId }: Props) => {
|
||||
name: data.name,
|
||||
certificateData: data.certificateData,
|
||||
privateKey: data.privateKey,
|
||||
autoRenew: data.autoRenew,
|
||||
};
|
||||
|
||||
const promise = certificateId
|
||||
@@ -232,22 +226,6 @@ export const HandleCertificate = ({ certificateId }: Props) => {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="autoRenew"
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex items-center gap-2">
|
||||
<FormControl>
|
||||
<Checkbox
|
||||
checked={field.value}
|
||||
onCheckedChange={field.onChange}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormLabel className="!mt-0">Auto-renew</FormLabel>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
{shouldShowServerDropdown && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
||||
@@ -90,7 +90,6 @@ export const certificateRouter = createTRPCRouter({
|
||||
name: input.name,
|
||||
certificateData: input.certificateData,
|
||||
privateKey: input.privateKey,
|
||||
autoRenew: input.autoRenew,
|
||||
});
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -56,7 +56,6 @@ export const apiUpdateCertificate = z.object({
|
||||
name: z.string().min(1).optional(),
|
||||
certificateData: z.string().min(1).optional(),
|
||||
privateKey: z.string().min(1).optional(),
|
||||
autoRenew: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const apiDeleteCertificate = z.object({
|
||||
|
||||
@@ -133,7 +133,6 @@ export const updateCertificate = async (
|
||||
name?: string;
|
||||
certificateData?: string;
|
||||
privateKey?: string;
|
||||
autoRenew?: boolean;
|
||||
},
|
||||
) => {
|
||||
const updated = await db
|
||||
|
||||
Reference in New Issue
Block a user