Skip to content

Commit eed0b98

Browse files
refactor: validate both country and iso2 fields in location filtering (#3394)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Ido Shamun <idoshamun@users.noreply.github.com>
1 parent f5d604b commit eed0b98

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/common/opportunity/parse.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,14 @@ export async function parseOpportunityWithBrokkr(
226226
return loc;
227227
})
228228
.filter((loc) => {
229-
// Only keep locations with valid country
230-
return loc?.country && loc.country.trim().length > 0;
229+
// Only keep locations with valid country and iso2
230+
// Both are required for downstream processing in gondul
231+
return (
232+
loc?.country &&
233+
loc.country.trim().length > 0 &&
234+
loc?.iso2 &&
235+
loc.iso2.trim().length > 0
236+
);
231237
})
232238
: [],
233239
};

0 commit comments

Comments
 (0)