Handle wiaas documents
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getDocumentIcon } from './DocumentHelper';
|
||||
|
||||
const DEFAULT_PACKAGE_IMG = 'static/img/no-photo-package.jpg';
|
||||
|
||||
@@ -49,12 +50,10 @@ export const fromWCPackage = wcPackage => {
|
||||
country: wcPackage.country,
|
||||
countryCode: wcPackage['country_code'],
|
||||
currency: wcPackage.currency,
|
||||
documents: wcPackage.documents ? wcPackage.documents.map(document => ({
|
||||
idDocument: document.id,
|
||||
documentName: document.name,
|
||||
extension: document.extension,
|
||||
idPackage: wcPackage.id,
|
||||
})) : [],
|
||||
documents: wcPackage.documents ? wcPackage.documents.map(document => {
|
||||
document.icon = getDocumentIcon(document.extension);
|
||||
return document;
|
||||
}) : [],
|
||||
shortDescription: wcPackage.description,
|
||||
prices: extractPrices(wcPackage.id, wcPackage.prices || []),
|
||||
groups: extractGroups(wcPackage.groups || {}),
|
||||
|
||||
Reference in New Issue
Block a user