feat: allow to specify additional files in the request

This commit is contained in:
mudler 2023-05-18 22:31:18 +02:00
parent 5a6d9d4e5b
commit 082e4f0da9

View file

@ -86,6 +86,8 @@ func (g *galleryApplier) start(c context.Context, cm *ConfigMerger) {
continue continue
} }
config.Files = append(config.Files, op.req.AdditionalFiles...)
if err := gallery.Apply(g.modelPath, op.req.Name, &config); err != nil { if err := gallery.Apply(g.modelPath, op.req.Name, &config); err != nil {
updateError(err) updateError(err)
continue continue
@ -106,8 +108,9 @@ func (g *galleryApplier) start(c context.Context, cm *ConfigMerger) {
// endpoints // endpoints
type ApplyGalleryModelRequest struct { type ApplyGalleryModelRequest struct {
URL string `json:"url"` URL string `json:"url"`
Name string `json:"name"` Name string `json:"name"`
AdditionalFiles []gallery.File `json:"file"`
} }
func getOpStatus(g *galleryApplier) func(c *fiber.Ctx) error { func getOpStatus(g *galleryApplier) func(c *fiber.Ctx) error {