fix(template): add missing file path

This commit is contained in:
Mauricio Siu
2024-08-02 13:40:25 -06:00
parent 16791a9f4b
commit ac26bb95e3
3 changed files with 16 additions and 16 deletions

View File

@@ -82,7 +82,7 @@ export const AddVolumes = ({
defaultValues: {
type: serviceType === "compose" ? "file" : "bind",
hostPath: "",
mountPath: serviceType === "compose" ? "/" : "",
mountPath: "",
},
resolver: zodResolver(mySchema),
});
@@ -330,22 +330,20 @@ export const AddVolumes = ({
/>
</>
)}
{serviceType !== "compose" && (
<FormField
control={form.control}
name="mountPath"
render={({ field }) => (
<FormItem>
<FormLabel>Mount Path (In the container)</FormLabel>
<FormControl>
<Input placeholder="Mount Path" {...field} />
</FormControl>
<FormField
control={form.control}
name="mountPath"
render={({ field }) => (
<FormItem>
<FormLabel>Mount Path (In the container)</FormLabel>
<FormControl>
<Input placeholder="Mount Path" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
)}
<FormMessage />
</FormItem>
)}
/>
</div>
</div>
</form>

View File

@@ -227,6 +227,7 @@ export const composeRouter = createTRPCRouter({
if (mounts && mounts?.length > 0) {
for (const mount of mounts) {
await createMount({
filePath: mount.filePath,
mountPath: mount.mountPath,
content: mount.content,
serviceId: compose.composeId,

View File

@@ -13,6 +13,7 @@ export interface Schema {
export interface Template {
envs: string[];
mounts?: {
filePath: string;
mountPath: string;
content?: string;
}[];