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

[ Fix/dev 94 ] 유저 구독 시 워크북 상세페이지 하단 ‘학습하기’ 로 변경 #157

Closed
wants to merge 7 commits into from

Conversation

soomin9106
Copy link
Collaborator

🔥 Related Issues

https://linear.app/fewletter/issue/DEV-94/%ED%98%84%EC%9E%AC-%EB%82%B4%EA%B0%80-%EA%B5%AC%EB%8F%85-%EC%A4%91%EC%9D%B8-%ED%95%99%EC%8A%B5%EC%A7%80%EC%9B%8C%ED%81%AC%EB%B6%81-%EC%83%81%EC%84%B8%ED%8E%98%EC%9D%B4%EC%A7%80%EB%A1%9C-%EB%93%A4%EC%96%B4%EA%B0%94%EC%9D%84-%EB%95%8C-%EC%9B%8C%ED%81%AC%EB%B6%81-%EC%83%81%EC%84%B8%ED%8E%98%EC%9D%B4%EC%A7%80-%ED%95%98%EB%8B%A8-%EA%B5%AC%EB%8F%85%ED%95%98%EA%B8%B0-%EB%B2%84%ED%8A%BC%EC%9D%B4-%ED%95%99%EC%8A%B5%ED%95%98%EA%B8%B0%EB%A1%9C-%EB%B0%94%EB%80%8C%EC%96%B4%EC%95%BC-%ED%95%A8

💜 작업 내용

  • WorkbookCardModel 사용하여 해당 워크북에 대한 구독 정보 가져와 학습 하기 버튼 클릭 시 유저 워크북 정보를 바탕으로 학습하기 버튼으로 이동하도록 연결
const workbookInfo = useQueries({
    queries: [
      getWorkbooksWithCategoryQueryOptions({
        code: ENTIRE_CATEGORY,
      }),
      {
        ...getSubscriptionWorkbooksQueryOptions(),
        enabled: isLogin === true,
      },
    ],
    combine: (result) => {
      const [workbookServerList, workbookSubscriptionInfoList] = result;

      if (workbookServerList.data) {
        const workbookCardModel = new WorkbookCardModel({
          initWorkbookSeverList: workbookServerList.data,
          initWorkbookSubscriptionInfoList: workbookSubscriptionInfoList.data,
        });

        // 특정 워크북 ID에 따른 필터링 적용
        const targetWorkbookId = Number(workbookId);
        const filteredWorkbookCombineList =
          workbookCardModel.workbookCombineListData.filter(
            (workbook) => workbook.id === targetWorkbookId,
          );

        return workbookCardModel.workbookCardList({
          workbookCombineList: filteredWorkbookCombineList,
        });
      }
    },
  });

👀 스크린샷 / GIF / 링크

2024-08-16.9.43.58.mov

@soomin9106
Copy link
Collaborator Author

soomin9106 commented Aug 16, 2024

현재 어느 day 학습 시에도 마지막 일자 학습하기로 넘어가는 것 같아 Draft 로 변경 해놓겠습니다!!
https://discord.com/channels/1243825896255918080/1244178559589810186/1273985480219955200

=> 저 아티클의 문제라네용 ㅋㅋㅋ 수정 완료 했다구 합니닷 ㅎㅎ

@soomin9106 soomin9106 marked this pull request as draft August 16, 2024 12:51
@soomin9106 soomin9106 marked this pull request as ready for review August 16, 2024 12:55
Copy link
Collaborator

@Happhee Happhee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한번체킹하고 작업하는것도 좋을것같습니다...! 그래도 고생했어요!

});
}
},
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

개인적인 의견인데 모델안에서 반환데이터를 반환하는게 더 가독성이 좋을것같아요. combine안에 비즈니스 로직이 들어가면 모델도 훑어보고 combine 내부도 봐야해서 공수가 2배로 들것같습니다...! 다른상황에서 해당 과정이 진행된다면 반영하면 좋을것같아요~

@soomin9106 soomin9106 closed this Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants