(w http.ResponseWriter, r *http.Request)
| 13 | ) |
| 14 | |
| 15 | func (a *API) loadInstance(w http.ResponseWriter, r *http.Request) (context.Context, error) { |
| 16 | instanceID, err := uuid.FromString(chi.URLParam(r, "instance_id")) |
| 17 | if err != nil { |
| 18 | return nil, badRequestError("Invalid instance ID") |
| 19 | } |
| 20 | logEntrySetField(r, "instance_id", instanceID) |
| 21 | |
| 22 | i, err := models.GetInstance(a.db, instanceID) |
| 23 | if err != nil { |
| 24 | if models.IsNotFoundError(err) { |
| 25 | return nil, notFoundError("Instance not found") |
| 26 | } |
| 27 | return nil, internalServerError("Database error loading instance").WithInternalError(err) |
| 28 | } |
| 29 | |
| 30 | return withInstance(r.Context(), i), nil |
| 31 | } |
| 32 | |
| 33 | func (a *API) GetAppManifest(w http.ResponseWriter, r *http.Request) error { |
| 34 | // TODO update to real manifest |
nothing calls this directly
no test coverage detected