This commit is contained in:
parent
9234e883e6
commit
39213020e2
@ -96,20 +96,20 @@ func (a *Server) instanceHandler(c echo.Context) error {
|
|||||||
tu := c.Param("uuid")
|
tu := c.Param("uuid")
|
||||||
u, err := uuid.Parse(tu)
|
u, err := uuid.Parse(tu)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.String(http.StatusNotFound, "404 not found")
|
return a.notFoundHandler(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
tc := pongo2.Context{}
|
tc := pongo2.Context{}
|
||||||
instances := a.feta.manager.ListInstances()
|
instances := a.feta.manager.ListInstances()
|
||||||
|
found := false
|
||||||
for _, item := range instances {
|
for _, item := range instances {
|
||||||
if item.UUID == u {
|
if item.UUID == u {
|
||||||
tc["instance"] = item
|
tc["instance"] = item
|
||||||
|
found = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, exists := tc["instance"]
|
if !found {
|
||||||
|
|
||||||
if !exists {
|
|
||||||
return a.notFoundHandler(c)
|
return a.notFoundHandler(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user