Problem
fetchFestivalEditionBySlug (src/api/editions/useFestivalEditionBySlug.ts) currently calls fetchFestivalBySlug(festivalSlug, signal) just to get festival.id, so it can filter festival_editions by festival_id. Callers often already have the festival id in context (e.g. from a parent route loader/params), so this does a redundant extra fetch.
Raised by @chiptus in review on #112: #112 (comment)
Suggested fix
Have fetchFestivalEditionBySlug accept festivalId directly where the caller already has it, instead of always re-deriving it from festivalSlug via a second fetch. Needs a look at all call sites of editionBySlugQuery/useFestivalEditionBySlugQuery to see where the festival id is already available (route loaders/params) vs. where only the slug is known.
Problem
fetchFestivalEditionBySlug(src/api/editions/useFestivalEditionBySlug.ts) currently callsfetchFestivalBySlug(festivalSlug, signal)just to getfestival.id, so it can filterfestival_editionsbyfestival_id. Callers often already have the festival id in context (e.g. from a parent route loader/params), so this does a redundant extra fetch.Raised by @chiptus in review on #112: #112 (comment)
Suggested fix
Have
fetchFestivalEditionBySlugacceptfestivalIddirectly where the caller already has it, instead of always re-deriving it fromfestivalSlugvia a second fetch. Needs a look at all call sites ofeditionBySlugQuery/useFestivalEditionBySlugQueryto see where the festival id is already available (route loaders/params) vs. where only the slug is known.