| 662 | } |
| 663 | |
| 664 | func (h *Handler) GetDaemonWorkspaceRepos(w http.ResponseWriter, r *http.Request) { |
| 665 | workspaceID := strings.TrimSpace(chi.URLParam(r, "workspaceId")) |
| 666 | if !h.requireDaemonWorkspaceAccess(w, r, workspaceID) { |
| 667 | return |
| 668 | } |
| 669 | |
| 670 | ws, err := h.Queries.GetWorkspace(r.Context(), parseUUID(workspaceID)) |
| 671 | if err != nil { |
| 672 | writeError(w, http.StatusNotFound, "workspace not found") |
| 673 | return |
| 674 | } |
| 675 | |
| 676 | writeJSON(w, http.StatusOK, workspaceReposResponse(workspaceID, ws.Repos, ws.Settings)) |
| 677 | } |
| 678 | |
| 679 | // DaemonDeregister marks runtimes as offline when the daemon shuts down. |
| 680 | func (h *Handler) DaemonDeregister(w http.ResponseWriter, r *http.Request) { |