diff --git a/manifest.json b/manifest.json index febf5ad..9ba9b76 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "vendor": "vtex", "version": "1.16.6", "title": "Wish List", - "description": "The Wishlist app is designed for B2C. It adds a heart icon to the Shelfs and Product Page, so the user can add it to the Wishlist, you can list all the Wishlisted items at /wishlist", + "description": "The Wishlist a pp is designed for B2C. It adds a heart icon to the Shelfs and Product Page, so the user can add it to the Wishlist, you can list all the Wishlisted items at /wishlist", "categories": [], "settingsSchema": {}, "builders": { diff --git a/react/WishlistAdmin.tsx b/react/WishlistAdmin.tsx index f9c80b3..25275f4 100644 --- a/react/WishlistAdmin.tsx +++ b/react/WishlistAdmin.tsx @@ -45,11 +45,18 @@ const WishlistAdmin: FC = ({ intl }) => { } } + const ws = XLSX.utils.json_to_sheet(data, { header }) const wb = XLSX.utils.book_new() XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') - const exportFileName = `wishlists_page_${selected1}.xls` - XLSX.writeFile(wb, exportFileName) + if(selected1 != null) { + const exportFileName = `wishlists_page_${selected1}.xls` + XLSX.writeFile(wb, exportFileName) + } else { + const exportFileName = `wishlists.xls` + XLSX.writeFile(wb, exportFileName) + + } } const { data, loading: queryLoading } = useQuery(exportList, {