Skip to content

fix(editions): accept festival id in fetchFestivalEditionBySlug instead of refetching festival #116

Description

@chiptus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions