fix(jobdanmark-search): filter search by the administrative regions locations returns (#650)

* fix(jobdanmark-search): filter search by the administrative regions locations returns

`locations` lists two kinds of region: landsdele such as Østjylland
(category `region`) and the administrative regions such as Region
Midtjylland (category `administrativeRegion`), and the search API
filters each by its own type. `--region` always sent type `region`, so
an administrative region - and SKILL.md's own `--region Midtjylland`
example - returned a successful search with zero jobs.

Add `--administrative-region`, sent as the `administrativeRegion`
filter, map each locations category to its flag in SKILL.md and the
README, and give `--region` examples that exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* changelog: place the #650 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 20:03:09 +02:00
1 parent a869a5a2dc
commit 09a8c31b24
5 files changed
+101 -5

No files matched your search

@@ -105,7 +105,10 @@ export const search = defineCommand({
description: "Zip code, e.g. 5000",
}),
region: option(z.string().optional(), {
description: "Region name",
description: "Landsdel from locations (category region), e.g. Sjælland, Østjylland",
}),
"administrative-region": option(z.string().optional(), {
description: "Administrative region from locations (category administrativeRegion), e.g. Region Midtjylland",
}),
"job-type": option(z.string().optional(), {
description: "Comma-separated job types: fuldtid,deltid,fleksjob,elev,studiejob,praktik",
@@ -143,6 +146,12 @@ export const search = defineCommand({
if (flags.region) {
filters.push({ type: "region", value: flags.region, displayText: flags.region })
}
// `locations` returns two kinds of region, and the API filters each by its
// own type: a "region" filter holding "Region Midtjylland" matches no job.
if (flags["administrative-region"]) {
const value = flags["administrative-region"]
filters.push({ type: "administrativeRegion", value, displayText: value })
}
const jobTypes = flags["job-type"]
? flags["job-type"].split(",").map((t) => t.trim()).filter(Boolean)