-
Notifications
You must be signed in to change notification settings - Fork 103
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
feat(composables): add onlyAvailable parameter #1378
feat(composables): add onlyAvailable parameter #1378
Conversation
…nd shipping methods
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/shopware-pwa/shopware-pwa-docs/3rnrhnkgTcJrsYiv5UGZ48wQMSHy |
…ent-methods-#1375
…1375' of github.com:vuestorefront/shopware-pwa into feat/list-only-available-shipping-and-payment-methods-#1375
💙 shopware-pwa-canary successfully deployed at https://ba2b5814ff99852a1aaaa1e84d9b260069df999f.shopware-pwa-canary.preview.storefrontcloud.io |
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.
Looks good, we should add more specific typing though :)
@@ -159,10 +159,14 @@ export async function getAvailableSalutations( | |||
* @beta | |||
*/ | |||
export async function getAvailablePaymentMethods( | |||
contextInstance: ShopwareApiInstance = defaultInstance | |||
contextInstance: ShopwareApiInstance = defaultInstance, | |||
params: any = {} |
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.
params: any = {} | |
params: { onlyAvailable?: boolean } = {} |
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.
added!
getContextPaymentMethodEndpoint() | ||
getContextPaymentMethodEndpoint(), | ||
{ | ||
params, // passing it as a last parameter won't cause a BC - to consider |
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.
is this comment necessary? There shouldn't be any BC here :)
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.
yes, removed
@@ -202,10 +206,14 @@ export async function setCurrentPaymentMethod( | |||
* @beta | |||
*/ | |||
export async function getAvailableShippingMethods( | |||
contextInstance: ShopwareApiInstance = defaultInstance | |||
contextInstance: ShopwareApiInstance = defaultInstance, | |||
params: any = {} // passing it as a last parameter won't cause a BC - to consider |
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.
params: any = {} // passing it as a last parameter won't cause a BC - to consider | |
params: { onlyAvailable?: boolean } = {} |
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.
cool, thanks! added a more detailed type
api/shopware-6-client.api.md
Outdated
@@ -165,13 +165,13 @@ export function getAvailableCurrencies(contextInstance?: ShopwareApiInstance): P | |||
export function getAvailableLanguages(contextInstance?: ShopwareApiInstance): Promise<Language[]>; | |||
|
|||
// @beta (undocumented) | |||
export function getAvailablePaymentMethods(contextInstance?: ShopwareApiInstance): Promise<PaymentMethod[]>; | |||
export function getAvailablePaymentMethods(contextInstance?: ShopwareApiInstance, params?: any): Promise<PaymentMethod[]>; |
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.
types should change here, after local rebuild
…ent-methods-#1375
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.
👌 excellent
closes #1375
Checklist