add req.query support
af4oz opened this issue · comments
GET /api/replies/test?thread_id=123
req.query is undefined
and also typescript issue
Property 'query' does not exist on type 'RestRequest<DefaultRequestBody, RequestParams>'
Hey, @zkindest.
MSW does not have a custom query
property on the request object. Instead, we use the standard URLSearchParams
under req.url.searchParams
. Learn more about working with query parameters.
In your example, accessing the query parameters would look like this:
const threadId = req.url.searchParams.get('thread_id')