File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -882,6 +882,11 @@ routes:
882
882
where t.id = ? and isDeleted = 0 and category = c.id; """
883
883
884
884
let threadRow = getRow(db, threadsQuery, id)
885
+ if threadRow[0 ].len == 0 :
886
+ let err = PostError(
887
+ message: " Specified thread does not exist"
888
+ )
889
+ resp Http404, $ (% err), " application/json"
885
890
let thread = selectThread(threadRow, selectThreadAuthor(id))
886
891
887
892
let postsQuery =
@@ -927,9 +932,14 @@ routes:
927
932
928
933
get " /specific_posts.json" :
929
934
createTFD()
930
- var
935
+ var ids: JsonNode
936
+ try :
931
937
ids = parseJson(@ " ids" )
932
-
938
+ except JsonParsingError:
939
+ let err = PostError(
940
+ message: " Invalid JSON in the `ids` parameter"
941
+ )
942
+ resp Http400, $ (% err), " application/json"
933
943
cond ids.kind == JArray
934
944
let intIDs = ids.elems.map(x => x.getInt())
935
945
let postsQuery = sql("""
Original file line number Diff line number Diff line change 7
7
post_id,
8
8
post_content,
9
9
cdate,
10
+ person .id ,
10
11
person .name AS author,
11
12
person .email AS email,
12
13
strftime(' %s' , person .lastOnline ) AS lastOnline,
You can’t perform that action at this time.
0 commit comments