Skip to content

Question: Hardcoded edition version in card route loader #2603

@theanand108

Description

@theanand108

While exploring the card routing logic I noticed that version resolution is handled differently in two similar routes.

In:

src/routes/edition/[edition]/+page.server.ts

the version is determined using:

const version = DeckService.getLatestVersion(edition);

However in:

src/routes/edition/[edition]/[card]/+page.server.ts

the version is hardcoded:

const version = edition == 'webapp'
  ? '2.2'
  : edition == 'mobileapp'
  ? '1.1'
  : '1.0';

I wanted to ask whether this difference is intentional (for example to lock the card route to specific versions), or if it would make sense to use DeckService.getLatestVersion() here as well for consistency.

Happy to submit a PR if aligning these would be appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions