Skip to content

Commit f1a5c15

Browse files
committed
fix: update storage adapter method names for consistency and bump adminforth dependency version
1 parent 8884a74 commit f1a5c15

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,11 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
625625
if (oldRecord[value]) {
626626
// put tag to delete old file
627627
try {
628-
await columnPlugin.pluginOptions.storageAdapter.markKeyForDeletation(oldRecord[value]);
628+
if (columnPlugin.pluginOptions.storageAdapter.markKeyForDeletion !== undefined) {
629+
await columnPlugin.pluginOptions.storageAdapter.markKeyForDeletion(oldRecord[value]);
630+
} else {
631+
await columnPlugin.pluginOptions.storageAdapter.markKeyForDeletation(oldRecord[value]);
632+
}
629633
} catch (e) {
630634
// file might be e.g. already deleted, so we catch error
631635
console.error(`Error setting tag to true for object ${oldRecord[value]}. File will not be auto-cleaned up`);
@@ -634,7 +638,11 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
634638
if (fieldsToUpdate[idx][value] && fieldsToUpdate[idx][value] !== null) {
635639
// remove tag from new file
636640
// in this case we let it crash if it fails: this is a new file which just was uploaded.
637-
await columnPlugin.pluginOptions.storageAdapter.markKeyForNotDeletation(fieldsToUpdate[idx][value]);
641+
if (columnPlugin.pluginOptions.storageAdapter.markKeyForNotDeletion !== undefined) {
642+
await columnPlugin.pluginOptions.storageAdapter.markKeyForNotDeletion(fieldsToUpdate[idx][value]);
643+
} else {
644+
await columnPlugin.pluginOptions.storageAdapter.markKeyForNotDeletation(fieldsToUpdate[idx][value]);
645+
}
638646
}
639647
}
640648
}

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@types/handlebars": "^4.0.40",
30-
"adminforth": "^2.4.0-next.222",
30+
"adminforth": "^2.4.0-next.315",
3131
"handlebars": "^4.7.8"
3232
},
3333
"release": {

0 commit comments

Comments
 (0)