Skip to content

Commit

Permalink
fix: import top pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dzehnder committed Jan 8, 2025
1 parent 21225a9 commit 9a0b443
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* governing permissions and limitations under the License.
*/

import { hasText } from '@adobe/spacecat-shared-utils';
import { hasText, isNonEmptyArray } from '@adobe/spacecat-shared-utils';

import BaseCollection from '../base/base.collection.js';

Expand All @@ -37,7 +37,9 @@ class SiteTopPageCollection extends BaseCollection {

const topPageIdsToRemove = topPagesToRemove.map((topPage) => topPage.getId());

await this.removeByIds(topPageIdsToRemove);
if (isNonEmptyArray(topPageIdsToRemove)) {
await this.removeByIds(topPageIdsToRemove);
}
}
}

Expand Down

0 comments on commit 9a0b443

Please sign in to comment.