mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
fix(template): app template v3 error [BE-11998] (#854)
This commit is contained in:
parent
8ffe4e284a
commit
c20a8b5a68
6 changed files with 21 additions and 19 deletions
|
@ -40,11 +40,13 @@ func (handler *Handler) fetchTemplates() (*listResponse, *httperror.HandlerError
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
err = json.NewDecoder(resp.Body).Decode(&body)
|
||||
if err != nil {
|
||||
if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
|
||||
return nil, httperror.InternalServerError("Unable to parse template file", err)
|
||||
}
|
||||
|
||||
for i := range body.Templates {
|
||||
body.Templates[i].ID = portainer.TemplateID(i + 1)
|
||||
}
|
||||
return body, nil
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue