Open ryanycw opened 1 month ago
Describe the solution you'd like
Refactor the current get post route to allow passing keywords as query params https://github.com/social-tw/social-tw-website/blob/9cc927d0b2cebc0d550c3463265bc8dc16a0ee05/packages/relay/src/routes/postRoute.ts#L18
And in fetchPosts search for content that contain keywords https://github.com/social-tw/social-tw-website/blob/9cc927d0b2cebc0d550c3463265bc8dc16a0ee05/packages/relay/src/services/PostService.ts#L143
if (keywords) { whereClause.content = { contains: keywords } }
Add test in post.test for fetchPosts with keyword https://github.com/social-tw/social-tw-website/blob/main/packages/relay/test/post.test.ts
Story Point: 3
Reporter: @ryanycw
I think it's related to https://github.com/social-tw/social-tw-website/issues/520, I will wait for the reply then implement it. thanks
Describe the solution you'd like
Refactor the current get post route to allow passing keywords as query params https://github.com/social-tw/social-tw-website/blob/9cc927d0b2cebc0d550c3463265bc8dc16a0ee05/packages/relay/src/routes/postRoute.ts#L18
And in fetchPosts search for content that contain keywords https://github.com/social-tw/social-tw-website/blob/9cc927d0b2cebc0d550c3463265bc8dc16a0ee05/packages/relay/src/services/PostService.ts#L143
Add test in post.test for fetchPosts with keyword https://github.com/social-tw/social-tw-website/blob/main/packages/relay/test/post.test.ts
Story Point: 3
Reporter: @ryanycw