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:
882882 where t.id = ? and isDeleted = 0 and category = c.id; """
883883
884884 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"
885890 let thread = selectThread (threadRow, selectThreadAuthor (id))
886891
887892 let postsQuery =
@@ -927,9 +932,14 @@ routes:
927932
928933 get " /specific_posts.json" :
929934 createTFD ()
930- var
935+ var ids: JsonNode
936+ try :
931937 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"
933943 cond ids.kind == JArray
934944 let intIDs = ids.elems.map (x => x.getInt ())
935945 let postsQuery = sql ("""
Original file line number Diff line number Diff line change 77 post_id,
88 post_content,
99 cdate,
10+ person .id ,
1011 person .name AS author,
1112 person .email AS email,
1213 strftime(' %s' , person .lastOnline ) AS lastOnline,
You can’t perform that action at this time.
0 commit comments