[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-11-05 06:27:27 +00:00
committed by GitHub
parent c5eb31ab90
commit 14dafa9a8a
2 changed files with 9 additions and 16 deletions
@@ -36,11 +36,7 @@ interface Props {
children?: React.ReactNode; children?: React.ReactNode;
} }
export const UploadFileModal = ({ export const UploadFileModal = ({ children, containerId, serverId }: Props) => {
children,
containerId,
serverId,
}: Props) => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const { mutateAsync: uploadFile, isLoading } = const { mutateAsync: uploadFile, isLoading } =
@@ -51,9 +47,7 @@ export const UploadFileModal = ({
form.reset(); form.reset();
}, },
onError: (error) => { onError: (error) => {
toast.error( toast.error(error.message || "Failed to upload file to container");
error.message || "Failed to upload file to container",
);
}, },
}); });
@@ -107,10 +101,7 @@ export const UploadFileModal = ({
</DialogHeader> </DialogHeader>
<Form {...form}> <Form {...form}>
<form <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
onSubmit={form.handleSubmit(onSubmit)}
className="space-y-4"
>
<FormField <FormField
control={form.control} control={form.control}
name="destinationPath" name="destinationPath"
@@ -126,8 +117,8 @@ export const UploadFileModal = ({
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
<p className="text-xs text-muted-foreground"> <p className="text-xs text-muted-foreground">
Enter the full path where the file should be Enter the full path where the file should be uploaded in the
uploaded in the container (e.g., /app/config.json) container (e.g., /app/config.json)
</p> </p>
</FormItem> </FormItem>
)} )}
@@ -194,4 +185,3 @@ export const UploadFileModal = ({
</Dialog> </Dialog>
); );
}; };
+4 -1
View File
@@ -19,7 +19,10 @@ export const uploadFileSchema = zfd.formData({
export type UploadFile = z.infer<typeof uploadFileSchema>; export type UploadFile = z.infer<typeof uploadFileSchema>;
export const uploadFileToContainerSchema = zfd.formData({ export const uploadFileToContainerSchema = zfd.formData({
containerId: z.string().min(1).regex(/^[a-zA-Z0-9.\-_]+$/, "Invalid container ID"), containerId: z
.string()
.min(1)
.regex(/^[a-zA-Z0-9.\-_]+$/, "Invalid container ID"),
file: zfd.file(), file: zfd.file(),
destinationPath: z.string().min(1), destinationPath: z.string().min(1),
serverId: z.string().optional(), serverId: z.string().optional(),