-
Notifications
You must be signed in to change notification settings - Fork 40
refactor: use VueQuery rather than SpaceConnector #5835
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
refactor: use VueQuery rather than SpaceConnector #5835
Conversation
Signed-off-by: yuda <yuda@megazone.com>
Signed-off-by: yuda <yuda@megazone.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Skipped Deployments
|
|
@yuda110 is attempting to deploy a commit to the cloudforet Team on Vercel. A member of the Team first needs to authorize it. |
|
🎉 @seungyeoneeee and @WANZARGEN have been randomly selected as the reviewers! Please review. 🙏 |
| const { data, isLoading, error } = useScopedQuery({ | ||
| queryKey: costReportConfigQueryKey, | ||
| queryFn: async () => { | ||
| const res = await costReportConfigAPI.list(params.value); | ||
| return res.results?.[0] ?? null; | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
It is recommended that Query data be maintained in the original data format received from the server, which is the rule for consistency of cached data when the same data is requested from somewhere else with the same key of the same structure.
If data processing is required, please use useQuery's select option or calculate it outside.
Query 데이터는 서버로부터 받은 원본 데이터 형식을 유지하는 것을 권장합니다. 같은 데이터를 같은 구조의 키로 다른 곳에서 요청했을 때, 캐시된 데이터의 정합성을 위한 룰입니다.
데이터 가공이 필요하다면, useQuery의 select옵션을 이용하거나 외부에서 계산해주세요.
| const { mutate: updateCostReportConfig } = useCostReportUpdateMutation({ | ||
| onSuccess: () => { | ||
| showSuccessMessage(i18n.t('BILLING.COST_MANAGEMENT.COST_REPORT.ALT_S_UPDATE_SETTINGS'), ''); | ||
| } catch (e) { | ||
| ErrorHandler.handleRequestError(e, i18n.t('BILLING.COST_MANAGEMENT.COST_REPORT.ALT_E_UPDATE_SETTINGS')); | ||
| } | ||
| }; | ||
| }, | ||
| onError: (error) => { | ||
| ErrorHandler.handleRequestError(error, i18n.t('BILLING.COST_MANAGEMENT.COST_REPORT.ALT_E_UPDATE_SETTINGS')); | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: If you don't need to sync or disable the cache, I don't think you need to use mutation!
쿼리 캐시의 동기화 혹은 무효화가 필요하지 않다면, 굳이 mutation을 이용할 필요는 없을 것 같습니다!
Signed-off-by: yuda <yuda@megazone.com>
7e33118
into
cloudforet-io:feature-cost-report
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
* feat: add vue query and mutation of `CostReport` Signed-off-by: yuda <yuda@megazone.com> * refactor: use VueQuery rather than SpaceConnector Signed-off-by: yuda <yuda@megazone.com> * fix: use `select` in `useCostReportConfigQuery` Signed-off-by: yuda <yuda@megazone.com> --------- Signed-off-by: yuda <yuda@megazone.com>
Skip Review (optional)
style,chore,ci,test,docs)Description (optional)
Things to Talk About (optional)