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

Add workspace querystring #32

Closed
wants to merge 6 commits into from
Closed

Conversation

analuizamtg
Copy link

What is the purpose of this pull request?

To add workspace querystring on all checkout requests

addWorkspaceQueryString = (url) ->
workspace = urlParam('workspace')
if workspace
if window.location.search.length > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Não entendi pra que serve esse if, vc nao deveria ver se na variável url tem parametros de queryString?


getGiftCardProviders: () =>
@ajax
url: addWorkspaceQueryString(window.location.origin + '/api/checkout/pub/gift-cards/providers')
Copy link
Contributor

Choose a reason for hiding this comment

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

Criar função privada para pegar a URL como é feito nos outros casos.

@ajax
type: 'POST',
contentType: 'application/json; charset=UTF-8',
url: addWorkspaceQueryString('/api/checkout/pub/orderForms/simulation'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Usar função

@@ -417,7 +429,7 @@ class Checkout
clearMessages: (expectedOrderFormSections = @_allOrderFormSections) =>
clearMessagesRequest = { expectedOrderFormSections: expectedOrderFormSections }
@ajax
url: @_getOrderFormURL() + '/messages/clear'
url: addWorkspaceQueryString(@_getOrderFormURL() + '/messages/clear')
Copy link
Contributor

Choose a reason for hiding this comment

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

Usar função

@@ -408,7 +420,7 @@ class Checkout
# Sends a request to retrieve the orders for a specific orderGroupId.
getOrders: (orderGroupId) =>
@ajax
url: @_getOrdersURL(orderGroupId)
url: addWorkspaceQueryString(@_getOrdersURL(orderGroupId) + workspaceQueryString)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tirar concatenação

@omninando omninando closed this Aug 27, 2019
@lucasecdb lucasecdb deleted the feature/workspace-querystring branch April 16, 2021 18:22
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.

3 participants