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

남의위키 기존 대시보드 타입을 그래픽 타입으로 통일 #178

Open
eun-seong opened this issue Jul 30, 2024 · 2 comments
Open
Assignees
Labels

Comments

@eun-seong
Copy link
Member

eun-seong commented Jul 30, 2024

기능 설명

대시보드 타입을 통일합니다.

요구 사항

  • HAPPY, SAD => BAR_CHART

  • BEST_WORTH => BUBBLE_CHART

  • CHARACTER => BINARY

  • DB에 있는 데이터를 업데이트

  • getDashboard 로직에서 이전 대시보드 타입으로 계산하는 로직 제거

  • 기존 대시보드 타입(HAPPY, SAD, BEST_WORTH, CHARACTER) 제거

@eun-seong eun-seong self-assigned this Jul 30, 2024
eun-seong added a commit that referenced this issue Aug 13, 2024
feat: DB에 존재하는 대시보드 타입 모두 반환하도록 수정(#178)
@eun-seong
Copy link
Member Author

db.dashboards.find({}).forEach(function (dashboard) {
    Object.values(dashboard.statistics).forEach((value) => {
        Object.entries(value).forEach(([key, v]) => {
            if (v.dashboardType === 'HAPPY' || v.dashboardType === 'SAD') {
                v.dashboardType = 'BAR_CHART';
            } else if (v.dashboardType === 'BEST_WORTH') {
                v.dashboardType = 'BUBBLE_CHART';
            } else if (v.dashboardType === 'CHARACTER') {
                v.dashboardType = 'BINARY';
            }
        })
    });

    db.dashboards.updateOne(
        {_id: dashboard._id},
        {$set: {"statistics": dashboard.statistics}}
        );
});

위 쿼리로 DB 데이터 변경해야 함

@eun-seong
Copy link
Member Author

@rlacksgus97 운영에 배포하기 전에 DB에 있는 questions.의 대시보드 타입 꼭 바꿔야 함

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant