diff --git a/backend/server/shared_routes.go b/backend/server/shared_routes.go index 3f338bec2..daa699185 100644 --- a/backend/server/shared_routes.go +++ b/backend/server/shared_routes.go @@ -5,6 +5,7 @@ import ( "github.com/ashirt-ops/ashirt-server/backend/contentstore" "github.com/ashirt-ops/ashirt-server/backend/database" + "github.com/ashirt-ops/ashirt-server/backend/helpers" "github.com/ashirt-ops/ashirt-server/backend/server/middleware" "github.com/ashirt-ops/ashirt-server/backend/services" "github.com/go-chi/chi/v5" @@ -48,4 +49,22 @@ func bindSharedRoutes(r chi.Router, db *database.Connection, contentStore conten } return services.CreateTag(r.Context(), db, i) })) + + route(r, "GET", "/operations/{operation_slug}/evidence", jsonHandler(func(r *http.Request) (interface{}, error) { + dr := dissectJSONRequest(r) + timelineFilters, err := helpers.ParseTimelineQuery(dr.FromQuery("query").AsString()) + if err != nil { + return nil, err + } + + i := services.ListEvidenceForOperationInput{ + OperationSlug: dr.FromURL("operation_slug").Required().AsString(), + Filters: timelineFilters, + } + if dr.Error != nil { + return nil, dr.Error + } + return services.ListEvidenceForOperation(r.Context(), db, contentStore, i) + })) + } diff --git a/backend/server/web.go b/backend/server/web.go index 9c443d059..da724887d 100644 --- a/backend/server/web.go +++ b/backend/server/web.go @@ -463,23 +463,6 @@ func bindWebRoutes(r chi.Router, db *database.Connection, contentStore contentst return nil, services.DeleteFinding(r.Context(), db, i) })) - route(r, "GET", "/operations/{operation_slug}/evidence", jsonHandler(func(r *http.Request) (interface{}, error) { - dr := dissectJSONRequest(r) - timelineFilters, err := helpers.ParseTimelineQuery(dr.FromQuery("query").AsString()) - if err != nil { - return nil, err - } - - i := services.ListEvidenceForOperationInput{ - OperationSlug: dr.FromURL("operation_slug").Required().AsString(), - Filters: timelineFilters, - } - if dr.Error != nil { - return nil, dr.Error - } - return services.ListEvidenceForOperation(r.Context(), db, contentStore, i) - })) - route(r, "GET", "/operations/{operation_slug}/evidence/creators", jsonHandler(func(r *http.Request) (interface{}, error) { dr := dissectJSONRequest(r)