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

allow custom host id when creating new entity for orderable assets #1035

Merged
merged 2 commits into from Aug 18, 2021
Merged

Conversation

simpian
Copy link
Contributor

@simpian simpian commented Aug 13, 2021

closes #1034

Copy link
Member

@michaelbromley michaelbromley left a comment

Choose a reason for hiding this comment

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

Thanks for the issue & fix. See my comment re the try-catch block.

default:
return `${camelCase(entityName, true)}Id`;
}
} catch (error) {
Copy link
Member

Choose a reason for hiding this comment

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

This try-catch block is redundant, since there is no possibility of an error being thrown from the switch statement. You can omit this and just use the switch statement instead.

@michaelbromley michaelbromley merged commit aeaf308 into vendure-ecommerce:master Aug 18, 2021
@michaelbromley
Copy link
Member

👍

@@ -565,8 +568,8 @@ export class AssetService {
case 'Collection':
return 'collectionId';
default:
throw new InternalServerError('error.could-not-find-matching-orderable-asset');
}
return `${camelCase(entityName, true)}Id`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@michaelbromley I accidentally added true flag in this function, can you please remove true flag that will actually turn the first letter capital making this Title case instead of camelCase,

sorry for the inconvenience, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Done in v1.1.5

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

Successfully merging this pull request may close these issues.

allow custom host id when creating new entity for orderable assets
2 participants