@yimingliao/cms 0.0.93 → 0.0.94
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/server/index.js +11 -3
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -3251,8 +3251,16 @@ function createFileSoftDeleteManyAction(ctx) {
|
|
|
3251
3251
|
const { ids: ids2 } = await fileSoftDeleteManyValidator(schemas).parseAsync(formData);
|
|
3252
3252
|
const foundFiles = await fileQueryRepository.findManyByIds({ ids: ids2 });
|
|
3253
3253
|
if (foundFiles.length === 0) throw ServerError.notFound();
|
|
3254
|
-
const
|
|
3255
|
-
const
|
|
3254
|
+
const lockedFiles = [];
|
|
3255
|
+
const targetIds = [];
|
|
3256
|
+
for (const file of foundFiles) {
|
|
3257
|
+
if (isFileLocked(file)) {
|
|
3258
|
+
lockedFiles.push(file.id);
|
|
3259
|
+
} else {
|
|
3260
|
+
targetIds.push(file.id);
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
const hasLockedFile = lockedFiles.length > 0;
|
|
3256
3264
|
const count = await fileCommandRepository.softDeleteMany({
|
|
3257
3265
|
ids: targetIds
|
|
3258
3266
|
});
|
|
@@ -3260,7 +3268,7 @@ function createFileSoftDeleteManyAction(ctx) {
|
|
|
3260
3268
|
throw new ServerError({ i18nKey: "error.files-batch-destroy-no" });
|
|
3261
3269
|
}
|
|
3262
3270
|
return {
|
|
3263
|
-
i18nKey: hasLockedFile ? "ok.destroy-
|
|
3271
|
+
i18nKey: hasLockedFile ? "ok.files-batch-destroy-has-locked" : "ok.destroy-ok"
|
|
3264
3272
|
};
|
|
3265
3273
|
},
|
|
3266
3274
|
{ type: "command" }
|