HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
프로그래머스 프론트엔드 데브코스 2기
프로그래머스 프론트엔드 데브코스 2기
/
😇
오프팀
/
🔥
팀 프로젝트 문서
/
전체검색 Q & A

전체검색 Q & A

상태
기타
담당자
  1. 현재 GET /search/users/{query}, GET /search/all/{query}를 사용했을 때 404에러가 발생합니다.
    1. notion image
- 오프팀은 다음과 같이 쿼리문을 작성했고 혹시 몰라서 /도 빼보고, 속성명을 query로도 바꿔봤으나 전부 404에러가 떴습니다.
notion image
사용자 조회시 존재하는 데이터이기 때문에 param의 문제는 아닌 것 같습니다.
notion image
혹시 api에 문제가 있을까요?
 

해결

#태그 사용 (전체검색 api 사용)
 
아래는 폐기

  1. 전체 검색 아예 path에 넣는 쿼리였음!! 쿼리 스트링 아냐
  • Post, User 검색
    • Get /search/all/{{fullName}} or {{title}}
      키워드 부분 검색 가능 => User, Post 둘 다 뽑아옴
  • User 검색
    • Get /search/users/{{fullName}}
      키워드 부분 검색 가능 => User
예 ) http://kdt.frontend.2nd.programmers.co.kr:5007/search/all/다육이
[{ // Post "likes": [], "comments": [], "_id": "62a0aaee703fdd3a82b4e728", "title": "다육이", "channel": "62a04aa2703fdd3a82b4e66e", "author": "629e29bd6d18b41c5b238ba2", "createdAt": "2022-06-08T13:58:06.891Z", "updatedAt": "2022-06-08T13:58:06.891Z", "__v": 0 }, { //User "role": "Regular", "emailVerified": false, "banned": false, "isOnline": false, "posts": [], "likes": [], "comments": [], "followers": [], "following": [], "notifications": [], "messages": [], "_id": "62a0ab92703fdd3a82b4e73f", "fullName": "다육이 엄마", "email": "user6@programmers.co.kr", "createdAt": "2022-06-08T14:00:50.128Z", "updatedAt": "2022-06-08T14:00:50.128Z", "__v": 0 } ]
 
  1. post 작성시 title에 json으로 직접 값을 넣어줬는데 GET /search/all/{query}의 쿼리문에 title안의 tag를 사용할 수 있을까요?
form-data title : { "title": "선인장 귀여워 ㅠㅠ", "contents": "애가 너무 이쁘지 않아요?" "tag":"선인장" // tag === '선인장'로 post를 가져올 예정입니다. }, image, channelId