@nkhang1902/strapi-plugin-export-import-clsx 1.5.1 → 1.5.3

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.
@@ -175,9 +175,9 @@ const ExportImportButtons = (props) => {
175
175
  const a = document.createElement("a");
176
176
  a.href = url;
177
177
 
178
- const filename = `${contentType.replace("api::", "")}-export-${
179
- new Date().toISOString().split("T")[0]
180
- }.xlsx`;
178
+ const filename = response.headers
179
+ .get("Content-Disposition")
180
+ .split("filename=")[1];
181
181
 
182
182
  a.download = filename;
183
183
  document.body.appendChild(a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nkhang1902/strapi-plugin-export-import-clsx",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "A powerful Strapi plugin for exporting and importing data with Excel support and advanced filtering",
5
5
  "main": "./strapi-server.js",
6
6
  "scripts": {
@@ -14,18 +14,14 @@ module.exports = ({ strapi }) => ({
14
14
  mode
15
15
  );
16
16
 
17
- const filename = `${
18
- contentType?.split(".")[1]|| "strapi"
19
- }-export-${new Date().toISOString().split("T")[0]}.xlsx`;
17
+ const filename = `${contentType?.split(".")[1]}-export-${new Date().toISOString().split("T")[0]}.xlsx`;
20
18
 
21
19
  if (mode === "participant") {
22
20
  const expName = await strapi.documents(contentType).findOne({
23
21
  select: ["name"],
24
- filters: {
25
- documentId: ctx.query[`filters[documentId][$eq]`],
26
- },
22
+ filters
27
23
  })
28
- filename = `${expName.name}-participant-export-${new Date().toISOString().split("T")[0]}.xlsx`;
24
+ filename = `${expName?.name}-participant-export-${new Date().toISOString().split("T")[0]}.xlsx`;
29
25
  }
30
26
 
31
27
  ctx.set(