beeequeue/dota-matches-api

Create League type and add url property to it

Closed this issue · 1 comments

Proposal

The URL data of a specific league can be easily obtained with minimal change (const leagueUrl = leagueLink$.attrs["href"]). Hence, I am proposing to add that to the current API response:

Option 1:

type League = {
  name: string | null
  url: string | null
}
 {
    // ...
    "league": {
      "name": "ESL One Malaysia 2022",
      "url": "https://liquipedia.net/dota2/ESL_One/Malaysia/2022"
    },
    "streamUrl": "https://liquipedia.net/dota2/Special:Stream/twitch/ESL_Dota_2"

Option 2:

 {
    // ...
    "leagueName": "ESL One Malaysia 2022",
    "leagueUrl": "https://liquipedia.net/dota2/ESL_One/Malaysia/2022",
    "streamUrl": "https://liquipedia.net/dota2/Special:Stream/twitch/ESL_Dota_2"

I understand that Option 1 is a breaking change. However, I do think that Option 1 is better here. What do you think?

It should definitely not be a breaking change, just have it be

{
  // ...
  "league": "ESL One Malaysia 2022",
  "leagueUrl": "https://liquipedia.net/dota2/ESL_One/Malaysia/2022"
}

later we could add a v2 endpoint where it uses the object format