Skip to content

Commit

Permalink
Refactor tag assignment to exclude home and salon when destination e…
Browse files Browse the repository at this point in the history
…xists
  • Loading branch information
jamalsoueidan committed May 30, 2024
1 parent f97eca4 commit 105ed84
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,20 @@ export const updateArticle = async ({
);
if (destination) {
tags.push("location-destination");
}
const originTypeHome = locations.find(
(l) => l.originType === LocationOriginTypes.HOME
);
if (originTypeHome) {
tags.push("location-home");
}

const originTypeSalon = locations.find(
(l) => l.originType === LocationOriginTypes.COMMERCIAL
);
if (originTypeSalon) {
tags.push("location-salon");
} else {
const originTypeHome = locations.find(
(l) => l.originType === LocationOriginTypes.HOME
);
if (originTypeHome) {
tags.push("location-home");
}

const originTypeSalon = locations.find(
(l) => l.originType === LocationOriginTypes.COMMERCIAL
);
if (originTypeSalon) {
tags.push("location-salon");
}
}
}

Expand Down

0 comments on commit 105ed84

Please sign in to comment.