Skip to content

Commit 9dead40

Browse files
committed
fix: add a check to make sure that asset ids is always an array
1 parent f6b26a3 commit 9dead40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/api.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ exports.restore = function restore(public_ids, callback, options = {}) {
128128
exports.restore_by_asset_ids = function restore_by_asset_ids(asset_ids, callback, options = {}) {
129129
options.content_type = "json";
130130
let uri = ["resources", "restore"];
131+
132+
// make sure asset_ids is always an array
133+
if (!Array.isArray(asset_ids)) {
134+
asset_ids = [asset_ids];
135+
}
136+
131137
return call_api(
132138
"post",
133139
uri,

0 commit comments

Comments
 (0)