From 082e4f0da9b0617cc476c205a8a8329ad4b9e0f8 Mon Sep 17 00:00:00 2001 From: mudler Date: Thu, 18 May 2023 22:31:18 +0200 Subject: [PATCH] feat: allow to specify additional files in the request --- api/gallery.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/gallery.go b/api/gallery.go index 5378c7bc..3d8a798d 100644 --- a/api/gallery.go +++ b/api/gallery.go @@ -86,6 +86,8 @@ func (g *galleryApplier) start(c context.Context, cm *ConfigMerger) { continue } + config.Files = append(config.Files, op.req.AdditionalFiles...) + if err := gallery.Apply(g.modelPath, op.req.Name, &config); err != nil { updateError(err) continue @@ -106,8 +108,9 @@ func (g *galleryApplier) start(c context.Context, cm *ConfigMerger) { // endpoints type ApplyGalleryModelRequest struct { - URL string `json:"url"` - Name string `json:"name"` + URL string `json:"url"` + Name string `json:"name"` + AdditionalFiles []gallery.File `json:"file"` } func getOpStatus(g *galleryApplier) func(c *fiber.Ctx) error {