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:
Mauricio Siu
2026-04-03 23:00:27 -06:00
parent 092212e225
commit 92caee5a77
4 changed files with 0 additions and 25 deletions

View File

@@ -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}

View File

@@ -90,7 +90,6 @@ export const certificateRouter = createTRPCRouter({
name: input.name,
certificateData: input.certificateData,
privateKey: input.privateKey,
autoRenew: input.autoRenew,
});
}),
});