mkfashion-sdk 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mkfashion-sdk-2.3.8.tgz +0 -0
- package/package.json +1 -1
- package/src/mkfashion.js +5 -4
- package/mkfashion-sdk-2.3.6.tgz +0 -0
|
Binary file
|
package/package.json
CHANGED
package/src/mkfashion.js
CHANGED
|
@@ -251,7 +251,7 @@ const mkfashion = {
|
|
|
251
251
|
this._log('Verificando disponibilidade', { projectId: resolved, identifier })
|
|
252
252
|
|
|
253
253
|
try {
|
|
254
|
-
const url = `${this.apiUrl}/availability/${resolved}/${identifier}`
|
|
254
|
+
const url = `${this.apiUrl}/availability/${resolved}/${encodeURIComponent(identifier)}`
|
|
255
255
|
const response = await fetch(url)
|
|
256
256
|
|
|
257
257
|
if (!response.ok) {
|
|
@@ -341,14 +341,14 @@ const mkfashion = {
|
|
|
341
341
|
this._log('Buscando produto', { projectId: resolved, identifier })
|
|
342
342
|
|
|
343
343
|
try {
|
|
344
|
-
const url = `${this.apiUrl}/products/${resolved}/${identifier}`
|
|
344
|
+
const url = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(identifier)}`
|
|
345
345
|
const response = await fetch(url)
|
|
346
346
|
|
|
347
347
|
if (!response.ok) {
|
|
348
348
|
// Fallback: tenta com productId do config caso caller tenha passado variantSku
|
|
349
349
|
if (response.status === 404 && this._config?.identifier && this._config.identifier !== identifier) {
|
|
350
350
|
this._log(`Identifier ${identifier} não encontrado, tentando com productId: ${this._config.identifier}`)
|
|
351
|
-
const fallbackUrl = `${this.apiUrl}/products/${resolved}/${this._config.identifier}`
|
|
351
|
+
const fallbackUrl = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(this._config.identifier)}`
|
|
352
352
|
const fallbackResponse = await fetch(fallbackUrl)
|
|
353
353
|
if (fallbackResponse.ok) {
|
|
354
354
|
const data = await fallbackResponse.json()
|
|
@@ -409,7 +409,7 @@ const mkfashion = {
|
|
|
409
409
|
},
|
|
410
410
|
|
|
411
411
|
_buildUrl() {
|
|
412
|
-
return `${this.appUrl}/${this._config.projectId}/${this._config.identifier}`
|
|
412
|
+
return `${this.appUrl}/${this._config.projectId}/${encodeURIComponent(this._config.identifier)}`
|
|
413
413
|
},
|
|
414
414
|
|
|
415
415
|
_openModal() {
|
|
@@ -676,6 +676,7 @@ const mkfashion = {
|
|
|
676
676
|
price: product.price || null,
|
|
677
677
|
sizePrice: product.sizePrice || null,
|
|
678
678
|
selectedSize: data?.size || null,
|
|
679
|
+
produtoVarianteId: product.produtoVarianteId || null,
|
|
679
680
|
productUrl: product.productUrl || null,
|
|
680
681
|
tryonImageUrl: product.tryonImageUrl || null
|
|
681
682
|
}
|
package/mkfashion-sdk-2.3.6.tgz
DELETED
|
Binary file
|