Skip to content

Commit 94dcf4d

Browse files
committed
return unknown activity
1 parent fe9c49e commit 94dcf4d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/main/com/yetanalytics/lrs/pedestal/routes/activities.cljc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313
[ctx {:keys [error activity] ?etag :etag :as _activity-response}]
1414
(if error
1515
(assoc ctx :io.pedestal.interceptor.chain/error error)
16-
(assoc ctx
17-
:response
18-
(if activity
19-
(cond-> {:status 200 :body activity}
16+
(let [activity-id (-> ctx
17+
:xapi
18+
:xapi.activities.GET.request/params
19+
:activityId)]
20+
(assoc ctx
21+
:response
22+
(cond-> {:status 200
23+
:body (or activity
24+
{"id" activity-id
25+
"objectType" "Activity"})}
2026
?etag (assoc :com.yetanalytics.lrs.pedestal.interceptor/etag
21-
?etag))
22-
{:status 404}))))
27+
?etag))))))
2328

2429
(def handle-get
2530
{:name ::handle-get

0 commit comments

Comments
 (0)