shift-org/shift-docs

Change API response when requesting an invalid event ID

開放

#566 建立於 2024年1月24日

 (1 則留言) (0 個反應) (1 位負責人)JavaScript (24 個分叉)auto 404
APIbackendgood first issue

倉庫指標

星標
 (28 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Currently, if you request a single event by ID (e.g. /events.php?id=99999) and the ID is non-existent or the event was deleted, we return a 200 OK response with an empty array. This is essentially a "not found" response, but in a roundabout way. We should just return a proper 404 response.

(But we should continue to return an empty array for day range requests that don't have any events scheduled. An empty array is meaningful in that scenario.)

貢獻者指南