diff --git a/src/utils/index2.js b/src/utils/index2.js index bbb5970e..0bd712f3 100644 --- a/src/utils/index2.js +++ b/src/utils/index2.js @@ -140,11 +140,22 @@ ${i + 1} of ${value.length}` // eslint-disable-next-line consistent-return export const handleDownload = async (input) => { - const { value, dispatch, setZip, setNotification, name, currentPlan } = input; - if (currentPlan === "free") { - dispatch(setToggleUpgradeModal(true)); - return; - } + const { dispatch, setZip, setNotification, name, currentPlan } = input; + // transform attribute to metadata format + let value = input.value; + value = value.map(({ attributes, ...v }) => { + let transformAttribute = attributes.map((attr) => ({ + trait_type: attr.trait_type, + value: attr.imageName, + rarity: attr.rarity, + })); + return { ...v, attributes: transformAttribute }; + }); + + // if (currentPlan === "free") { + // dispatch(setToggleUpgradeModal(true)); + // return; + // } if (!name) { return dispatch( setNotification({