@nkhang1902/strapi-plugin-export-import-clsx 1.2.5 → 1.2.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nkhang1902/strapi-plugin-export-import-clsx",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
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": {
|
|
@@ -152,11 +152,18 @@ module.exports = ({ strapi }) => ({
|
|
|
152
152
|
const targetAttr = strapi.contentTypes[target].attributes;
|
|
153
153
|
for (const field of SHORTCUT_FIELDS) {
|
|
154
154
|
if (!targetAttr[field]) continue;
|
|
155
|
+
const filters = {
|
|
156
|
+
[field]: { $eq: value },
|
|
157
|
+
};
|
|
158
|
+
if (targetAttr.event && eventId) {
|
|
159
|
+
filters.event = {
|
|
160
|
+
documentId: { $eq: eventId },
|
|
161
|
+
};
|
|
162
|
+
}
|
|
155
163
|
const existing = await strapi.documents(target).findFirst({
|
|
156
|
-
filters
|
|
164
|
+
filters,
|
|
157
165
|
});
|
|
158
166
|
if (existing) return { id: existing.id };
|
|
159
|
-
// throw new Error(`Not found.`);
|
|
160
167
|
return null;
|
|
161
168
|
}
|
|
162
169
|
return null;
|