Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

단건 관심 과목을 상세 조회 API의 응답을 수정한다. #48

Closed
3Juhwan opened this issue Feb 7, 2025 · 0 comments · Fixed by #49
Closed

단건 관심 과목을 상세 조회 API의 응답을 수정한다. #48

3Juhwan opened this issue Feb 7, 2025 · 0 comments · Fixed by #49
Assignees
Labels
버그 버그를 찾았어요.

Comments

@3Juhwan
Copy link
Member

3Juhwan commented Feb 7, 2025

문제 상황

GET /api/baskets/{subjectId} 의 일부 요청에서 null을 포함한 응답이 나오는 경우가 있습니다.
과목(subject)에 등록된 관심과목등록(basket)이 없을 때, 빈 리스트가 응답되길 기대합니다.

기대한 응답

{
    "eachDepartmentRegisters": []
}

실제 응답

{
    "eachDepartmentRegisters": [
        {
            "studentBelong": null,
            "registerDepartment": null,
            "eachCount": null
        }
    ]
}

문제 원인

문제를 재현할 수 있는 요청은 GET /api/baskets/2입니다. Subject id가 2인 상황에 문제가 발생합니다.
Subject id = 2 일 때의 관담 데이터 크롤링 결과가 예상하지 못한 내용이었습니다.
관담 인원이 없는 과목에 대해 관담 데이터를 요청하면 빈 리스트가 아닌, 더미 데이터를 응답 받습니다.

Image

위 더미데이터가 Basket 테이블을 삽입하게 되고, 관담 데이터가 없는 Subject에 대해 관담 데이터를 조회하면 null로 가득한 Basket 레코드 하나가 응답됩니다.
그렇게 하여 클라이언트는 다음 응답을 받게 됩니다.

{
    "eachDepartmentRegisters": [
        {
            "studentBelong": null,
            "registerDepartment": null,
            "eachCount": null
        }
    ]
}

재현 방법

GET /api/baskets/{subjectId} 요청을 보냅니다.

Subject.id = 2인 과목은 세종인을위한진로설계AI로봇학과1 대상과목입니다.
해당 과목은 관심과목 담기한 인원이 없습니다. 하지만 크롤링 결과 텅 빈 Basket이 조회됩니다.

@3Juhwan 3Juhwan added 개선 프로덕트에 개선이 필요해요. 버그 버그를 찾았어요. labels Feb 7, 2025
@3Juhwan 3Juhwan self-assigned this Feb 7, 2025
@3Juhwan 3Juhwan removed the 개선 프로덕트에 개선이 필요해요. label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
버그 버그를 찾았어요.
Projects
None yet
1 participant