feat: improve timeline/admin flows and ingest projection repairs
This commit is contained in:
@@ -30,6 +30,24 @@ func RegisterAssetComponentRoutes(mux *http.ServeMux, deps AssetComponentDepende
|
||||
}
|
||||
|
||||
func (h assetComponentHandlers) handleAsset(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasSuffix(r.URL.Path, "/imports") {
|
||||
if r.Method != http.MethodGet {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
if h.deps.Timeline == nil {
|
||||
writeError(w, http.StatusInternalServerError, "import history unavailable")
|
||||
return
|
||||
}
|
||||
id, ok := parseSubresourceID(r.URL.Path, "/assets/", "/imports")
|
||||
if !ok {
|
||||
writeError(w, http.StatusNotFound, "asset import history not found")
|
||||
return
|
||||
}
|
||||
writeImportHistoryResponse(w, r, h.deps.Timeline, "asset", id)
|
||||
return
|
||||
}
|
||||
|
||||
if strings.HasSuffix(r.URL.Path, "/timeline") {
|
||||
if r.Method != http.MethodGet {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
@@ -107,6 +125,24 @@ func (h assetComponentHandlers) handleAsset(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
func (h assetComponentHandlers) handleComponent(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasSuffix(r.URL.Path, "/imports") {
|
||||
if r.Method != http.MethodGet {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
if h.deps.Timeline == nil {
|
||||
writeError(w, http.StatusInternalServerError, "import history unavailable")
|
||||
return
|
||||
}
|
||||
id, ok := parseSubresourceID(r.URL.Path, "/components/", "/imports")
|
||||
if !ok {
|
||||
writeError(w, http.StatusNotFound, "component import history not found")
|
||||
return
|
||||
}
|
||||
writeImportHistoryResponse(w, r, h.deps.Timeline, "component", id)
|
||||
return
|
||||
}
|
||||
|
||||
if strings.HasSuffix(r.URL.Path, "/timeline") {
|
||||
if r.Method != http.MethodGet {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
|
||||
Reference in New Issue
Block a user