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

Next: Add id to loggers in core factories #5380

Merged
merged 4 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/core/src/factories/useCategoryFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function useCategoryFactory<CATEGORY, CATEGORY_SEARCH_PARAMS>(
const error: Ref<UseCategoryErrors> = sharedRef({}, `useCategory-error-${id}`);

const search = async (searchParams) => {
Logger.debug('useCategory.search', searchParams);
Logger.debug(`useCategory/${id}/search`, searchParams);

try {
loading.value = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/src/factories/useContentFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function useContentFactory<CONTENT, CONTENT_SEARCH_PARAMS>(
const context = generateContext(factoryParams);

const search = async(params: CONTENT_SEARCH_PARAMS): Promise<void> => {
Logger.debug('useContent.search', params);
Logger.debug(`useContent/${id}/search`, params);

try {
loading.value = true;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/core/src/factories/useFacetFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const useFacetFactory = <SEARCH_DATA>(factoryParams: UseFacetFactoryParams<SEARC
const error: Ref<UseFacetErrors> = sharedRef({}, `useFacet-error-${id}`);

const search = async (params?: AgnosticFacetSearchParams) => {
Logger.debug('useFacet.search', params);
Logger.debug(`useFacet/${ssrKey}/search`, params);

result.value.input = params;
try {
Expand All @@ -25,7 +25,7 @@ const useFacetFactory = <SEARCH_DATA>(factoryParams: UseFacetFactoryParams<SEARC
result.value.data = await factoryParams.search(context, result.value);
} catch (err) {
error.value.search = err;
Logger.error(`useFacet/${id}/search`, err);
Logger.error(`useFacet/${ssrKey}/search`, err);
} finally {
loading.value = false;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/src/factories/useProductFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function useProductFactory<PRODUCTS, PRODUCT_SEARCH_PARAMS>(
const error: Ref<UseProductErrors> = sharedRef({}, `useProduct-error-${id}`);

const search = async (searchParams) => {
Logger.debug('useProduct.search', searchParams);
Logger.debug(`useProduct/${id}/search`, searchParams);

try {
loading.value = true;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/core/src/factories/useReviewFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function useReviewFactory<REVIEW, REVIEWS_SEARCH_PARAMS, REVIEW_ADD_PARAM
const context = generateContext(factoryParams);

const search = async (searchParams): Promise<void> => {
Logger.debug('useReview.search', searchParams);
Logger.debug(`useReview/${id}/search`, searchParams);
lukaszjedrasik marked this conversation as resolved.
Show resolved Hide resolved

try {
loading.value = true;
Expand All @@ -32,7 +32,7 @@ export function useReviewFactory<REVIEW, REVIEWS_SEARCH_PARAMS, REVIEW_ADD_PARAM
};

const addReview = async (params): Promise<void> => {
Logger.debug('useReview.addReview', params);
Logger.debug(`useReview/${id}/addReview`, params);

try {
loading.value = true;
Expand Down
1 change: 1 addition & 0 deletions packages/core/docs/contributing/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- added missing `i18n` tags ([#5337](https://github.com/vuestorefront/vue-storefront/issues/5337))
- fix adding to cart button on product page ([#5375](https://github.com/vuestorefront/vue-storefront/pull/5375))
- typed error ref for each core's factory ([#4956](https://github.com/vuestorefront/vue-storefront/issues/4956))
- added ID to Loggers in core factories ([#5351](https://github.com/vuestorefront/vue-storefront/issues/5351))


## 2.1.1-rc.1
Expand Down