Skip to content

Commit b7b4fde

Browse files
authored
mark up clean up fix (#241)
fixed an issue where markup cleanup falsely flag a markup for deletion/unpublish due to an issue with finding the urlkey
1 parent 157dc2d commit b7b4fde

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

actions/mark-up-clean-up/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const {
3131
*/
3232
function urlkeymatch(publishedProduct, queriedProducts){
3333
let path = publishedProduct.path.split('/');
34-
path = path.pop();
34+
3535
const result = queriedProducts.some((product) => {
36-
if (path === product.urlKey) {
36+
if (path.includes(product.urlKey)) {
3737
return true;
3838
}
3939
});
@@ -55,7 +55,7 @@ async function markUpCleanUP(context, filesLib, logger, adminApi) {
5555

5656
const redundantpublishedProducts = publishedProducts.data.filter((product) => !urlkeymatch(product, queryResult))
5757
context.counts.detected = redundantpublishedProducts.length;
58-
58+
5959
for (const product of redundantpublishedProducts) {
6060
try {
6161
const result = await filesLib.delete(`/public/pdps${product.path}.${PDP_FILE_EXT}`);

0 commit comments

Comments
 (0)