strapi-plugin-bulk-updater 1.2.10 → 1.2.11
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/dist/_chunks/{BulkUpdater-Cg9utqzm.mjs → BulkUpdater-B_COVQmo.mjs} +30 -17
- package/dist/_chunks/BulkUpdater-B_COVQmo.mjs.map +1 -0
- package/dist/_chunks/{BulkUpdater-EI4sKaLN.js → BulkUpdater-DS6gm_qd.js} +30 -17
- package/dist/_chunks/BulkUpdater-DS6gm_qd.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +6 -12
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +6 -12
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/BulkUpdater-Cg9utqzm.mjs.map +0 -1
- package/dist/_chunks/BulkUpdater-EI4sKaLN.js.map +0 -1
package/dist/server/index.mjs
CHANGED
|
@@ -281,10 +281,6 @@ const bulkUpdaterController = ({ strapi: strapi2 }) => ({
|
|
|
281
281
|
if (data?.etag) {
|
|
282
282
|
ctx.set("ETag", data.etag);
|
|
283
283
|
ctx.set("Cache-Control", "private, no-cache");
|
|
284
|
-
if (ctx.request.headers["if-none-match"] === data.etag) {
|
|
285
|
-
ctx.status = 304;
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
284
|
}
|
|
289
285
|
ctx.body = data;
|
|
290
286
|
} catch (err) {
|
|
@@ -310,10 +306,6 @@ const bulkUpdaterController = ({ strapi: strapi2 }) => ({
|
|
|
310
306
|
if (data?.etag) {
|
|
311
307
|
ctx.set("ETag", data.etag);
|
|
312
308
|
ctx.set("Cache-Control", "private, no-cache");
|
|
313
|
-
if (ctx.request.headers["if-none-match"] === data.etag) {
|
|
314
|
-
ctx.status = 304;
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
309
|
}
|
|
318
310
|
ctx.body = { success: true, ...data };
|
|
319
311
|
} catch (err) {
|
|
@@ -1390,10 +1382,12 @@ const bulkUpdaterService = ({ strapi: strapi2 }) => {
|
|
|
1390
1382
|
}
|
|
1391
1383
|
let condition = void 0;
|
|
1392
1384
|
const q = (filterQuery || "").trim();
|
|
1385
|
+
const targetAttrSchema = isNestedAttr ? strapi2.components[attrs[parentKey]?.component]?.attributes?.[childKey] : attrs[attribute];
|
|
1386
|
+
const isStringLike = ["string", "text", "email", "richtext", "uid"].includes(targetAttrSchema?.type);
|
|
1393
1387
|
if (normOp === "empty") {
|
|
1394
|
-
condition = { $or: [{ $null: true }, { $eq: "" }] };
|
|
1388
|
+
condition = isStringLike ? { $or: [{ $null: true }, { $eq: "" }] } : { $null: true };
|
|
1395
1389
|
} else if (normOp === "notempty") {
|
|
1396
|
-
condition = { $and: [{ $notNull: true }, { $ne: "" }] };
|
|
1390
|
+
condition = isStringLike ? { $and: [{ $notNull: true }, { $ne: "" }] } : { $notNull: true };
|
|
1397
1391
|
} else if (q !== "") {
|
|
1398
1392
|
switch (normOp) {
|
|
1399
1393
|
case "equals":
|
|
@@ -1422,12 +1416,12 @@ const bulkUpdaterService = ({ strapi: strapi2 }) => {
|
|
|
1422
1416
|
[childKey]: condition
|
|
1423
1417
|
};
|
|
1424
1418
|
} else {
|
|
1425
|
-
if (normOp === "empty") {
|
|
1419
|
+
if (normOp === "empty" && isStringLike) {
|
|
1426
1420
|
filters2.$or = [
|
|
1427
1421
|
{ [attribute]: { $null: true } },
|
|
1428
1422
|
{ [attribute]: { $eq: "" } }
|
|
1429
1423
|
];
|
|
1430
|
-
} else if (normOp === "notempty") {
|
|
1424
|
+
} else if (normOp === "notempty" && isStringLike) {
|
|
1431
1425
|
filters2[attribute] = { $notNull: true, $ne: "" };
|
|
1432
1426
|
} else {
|
|
1433
1427
|
filters2[attribute] = condition;
|