File tree Expand file tree Collapse file tree 2 files changed +129
-101
lines changed
src/education/http/endpoints
test/education/http/endpoints Expand file tree Collapse file tree 2 files changed +129
-101
lines changed Original file line number Diff line number Diff line change 84
84
(not-found {:message not-found-error-message})
85
85
(ok (to-short-article-response mf-article)))))
86
86
87
+ (defn- get-last-featured-articles-handler
88
+ " Get last featured articles handler."
89
+ [db limit]
90
+ (->> (articlesdb/get-last-featured-articles db limit)
91
+ (map to-short-article-response)
92
+ ok))
93
+
87
94
(defn- delete-article-handler
88
95
" Delete article by `article-id` handler."
89
96
[db article-id]
135
142
:return ::specs/article-short
136
143
:summary " Get main featured article"
137
144
(get-last-main-featured-article-handler db))
145
+ (GET " /articles/featured/latest" []
146
+ :return ::specs/articles-short
147
+ :query-params [limit :- ::specs/limit ]
148
+ :summary " Get latest featured articles list"
149
+ (get-last-featured-articles-handler db limit))
138
150
(DELETE " /articles/:id" []
139
151
:middleware [[require-roles #{:moderator }]]
140
152
:path-params [id :- ::specs/id ]
You can’t perform that action at this time.
0 commit comments