Skip to content

Commit

Permalink
refactor: seller quotes client constants
Browse files Browse the repository at this point in the history
  • Loading branch information
tiago-freire committed Dec 15, 2024
1 parent 92ef22e commit fbb6529
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions node/clients/SellerQuotesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const SELLER_CLIENT_OPTIONS: InstanceOptions = {
initialBackoffDelay: 100,
}

const routes = {
const BASE_PATH = 'b2b-seller-quotes/_v/0'

const ROUTES = {
verifyQuoteSettings: 'verify-quote-settings',
notifyNewQuote: 'notify-new-quote',
}
Expand All @@ -32,12 +34,12 @@ export default class SellerQuotesClient extends ExternalClient {
? sellerAccount
: `${this.context.workspace}--${sellerAccount}`

return `http://${subdomain}.myvtex.com/b2b-seller-quotes/_v/0/${path}`
return `http://${subdomain}.myvtex.com/${BASE_PATH}/${path}`
}

public async verifyQuoteSettings(sellerAccount: string) {
return this.http.get<VerifyQuoteSettingsResponse>(
this.getRoute(sellerAccount, routes.verifyQuoteSettings)
this.getRoute(sellerAccount, ROUTES.verifyQuoteSettings)
)
}

Expand All @@ -48,7 +50,7 @@ export default class SellerQuotesClient extends ExternalClient {
}

return this.http.postRaw(
this.getRoute(sellerAccount, routes.notifyNewQuote),
this.getRoute(sellerAccount, ROUTES.notifyNewQuote),
payload
)
}
Expand Down

0 comments on commit fbb6529

Please sign in to comment.