Skip to content

Commit

Permalink
Merge pull request #370 from tskxz/fix/update_nba
Browse files Browse the repository at this point in the history
fix: update nba league
  • Loading branch information
ageddesi authored Nov 27, 2024
2 parents 88da22f + e67bc99 commit c14dde2
Show file tree
Hide file tree
Showing 2 changed files with 278 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/modules/sports/api/sports-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getRandomSubArray } from '../../../utils/arrays';
import PremierLeagueData2022 from '../data/football-premier-league-2022';
import LaLigaLeagueData2022 from '../data/football-laliga-league-2022';
import SerieALeagueData2022 from '../data/football-serie-a-league-2022';
import BasketballNbaLeague2022 from '../data/basketball-nba-league-2022';
import BasketballNbaLeague2024 from '../data/basketball-nba-league-2024';
import Ligue1LeagueData2022 from '../data/football-ligue-1-league-2022';

module.exports = function (app: core.Express) {

Check warning on line 11 in api/src/modules/sports/api/sports-routes.ts

View check run for this annotation

Codeac.io / Codeac Code Quality

only-arrow-functions

non-arrow functions are forbidden
Expand All @@ -32,7 +32,7 @@ module.exports = function (app: core.Express) {
*/
app.get('/sports/basketball/leagues/nba/teams/:qty?', (req: Request, res: Response) => {
const qty = getQtyFromRequest(req);
res.json(getRandomSubArray(BasketballNbaLeague2022, qty));
res.json(getRandomSubArray(BasketballNbaLeague2024, qty));
});

/**
Expand Down
276 changes: 276 additions & 0 deletions api/src/modules/sports/data/basketball-nba-league-2024.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
import BasketBallTeam from '../consts/BasketBallTeam';

const NBALeagueData: BasketBallTeam[] = [
{
abbr: 'ATL',
conference: 'Eastern',
division: 'Southeast',
city: 'Atlanta',
name: 'Hawks',
color: 'C8102E',
colors: ['C8102E', 'FFD100', '000000'],
},
{
abbr: 'BOS',
conference: 'Eastern',
division: 'Atlantic',
city: 'Boston',
name: 'Celtics',
color: '007A33',
colors: ['007A33', 'BA9653', '963821'],
},
{
abbr: 'BKN',
conference: 'Eastern',
division: 'Atlantic',
city: 'Brooklyn',
name: 'Nets',
color: '000000',
colors: ['000000', 'FFFFFF'],
},
{
abbr: 'CHA',
conference: 'Eastern',
division: 'Southeast',
city: 'Charlotte',
name: 'Hornets',
color: '00788C',
colors: ['00788C', '1D1160', 'A1A1A4'],
},
{
abbr: 'CHI',
conference: 'Eastern',
division: 'Central',
city: 'Chicago',
name: 'Bulls',
color: 'CE1141',
colors: ['CE1141', '000000'],
},
{
abbr: 'CLE',
conference: 'Eastern',
division: 'Central',
city: 'Cleveland',
name: 'Cavaliers',
color: '860038',
colors: ['860038', 'FDBB30', '041E42'],
},
{
abbr: 'DAL',
conference: 'Western',
division: 'Southwest',
city: 'Dallas',
name: 'Mavericks',
color: '00538C',
colors: ['00538C', '002B5E', '8D9093'],
},
{
abbr: 'DEN',
conference: 'Western',
division: 'Northwest',
city: 'Denver',
name: 'Nuggets',
color: '0E2240',
colors: ['0E2240', 'FEC524', '8B2131'],
},
{
abbr: 'DET',
conference: 'Eastern',
division: 'Central',
city: 'Detroit',
name: 'Pistons',
color: 'C8102E',
colors: ['C8102E', '1D42BA', 'BEC0C2'],
},
{
abbr: 'GSW',
conference: 'Western',
division: 'Pacific',
city: 'Golden State',
name: 'Warriors',
color: '1D428A',
colors: ['1D428A', 'FFC72C'],
},
{
abbr: 'HOU',
conference: 'Western',
division: 'Southwest',
city: 'Houston',
name: 'Rockets',
color: 'CE1141',
colors: ['CE1141', 'C4CED4', '000000'],
},
{
abbr: 'IND',
conference: 'Eastern',
division: 'Central',
city: 'Indiana',
name: 'Pacers',
color: '002D62',
colors: ['002D62', 'FDBB30', 'BEC0C2'],
},
{
abbr: 'LAC',
conference: 'Western',
division: 'Pacific',
city: 'Los Angeles',
name: 'Clippers',
color: 'C8102E',
colors: ['C8102E', '1D42BA', 'BEC0C2'],
},
{
abbr: 'LAL',
conference: 'Western',
division: 'Pacific',
city: 'Los Angeles',
name: 'Lakers',
color: '552583',
colors: ['552583', 'FDB927', '000000'],
},
{
abbr: 'MEM',
conference: 'Western',
division: 'Southwest',
city: 'Memphis',
name: 'Grizzlies',
color: '5D76A9',
colors: ['5D76A9', '12173F', 'F5B112'],
},
{
abbr: 'MIA',
conference: 'Eastern',
division: 'Southeast',
city: 'Miami',
name: 'Heat',
color: '98002E',
colors: ['98002E', 'F9A01B', '000000'],
},
{
abbr: 'MIL',
conference: 'Eastern',
division: 'Central',
city: 'Milwaukee',
name: 'Bucks',
color: '00471B',
colors: ['00471B', 'EEE1C6', '0077C0'],
},
{
abbr: 'MIN',
conference: 'Western',
division: 'Northwest',
city: 'Minnesota',
name: 'Timberwolves',
color: '0C2340',
colors: ['0C2340', '236192', '78BE20'],
},
{
abbr: 'NOP',
conference: 'Western',
division: 'Southwest',
city: 'New Orleans',
name: 'Pelicans',
color: '0C2340',
colors: ['0C2340', '85714D', 'E31837'],
},
{
abbr: 'NYK',
conference: 'Eastern',
division: 'Atlantic',
city: 'New York',
name: 'Knicks',
color: '006BB6',
colors: ['006BB6', 'F58426', 'BEC0C2'],
},
{
abbr: 'OKC',
conference: 'Western',
division: 'Northwest',
city: 'Oklahoma City',
name: 'Thunder',
color: '007AC1',
colors: ['007AC1', 'EF3B24', 'FDBB30'],

Check warning on line 191 in api/src/modules/sports/data/basketball-nba-league-2024.ts

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 18 lines is too similar to api/src/modules/sports/data/basketball-nba-league-2022.ts:173
},
{
abbr: 'ORL',
conference: 'Eastern',
division: 'Southeast',
city: 'Orlando',
name: 'Magic',
color: '0077C0',
colors: ['0077C0', 'C4CED4', '000000'],
},
{
abbr: 'PHI',
conference: 'Eastern',
division: 'Atlantic',
city: 'Philadelphia',
name: '76ers',
color: '006BB6',
colors: ['006BB6', 'ED174C', '002B5C'],
},
{
abbr: 'PHX',
conference: 'Western',
division: 'Pacific',
city: 'Phoenix',
name: 'Suns',
color: 'E56020',
colors: ['E56020', '1D1160', '63727A'],
},
{
abbr: 'POR',
conference: 'Western',
division: 'Northwest',
city: 'Portland',
name: 'Trail Blazers',
color: 'E03A3E',
colors: ['E03A3E', '000000', 'BAC3C9'],
},
{
abbr: 'SAC',
conference: 'Western',
division: 'Pacific',
city: 'Sacramento',
name: 'Kings',
color: '5A2D81',
colors: ['5A2D81', '63727A', '000000'],
},
{
abbr: 'SAS',
conference: 'Western',
division: 'Southwest',
city: 'San Antonio',
name: 'Spurs',
color: 'C4CED4',
colors: ['C4CED4', '000000'],
},
{
abbr: 'TOR',
conference: 'Eastern',
division: 'Atlantic',
city: 'Toronto',
name: 'Raptors',
color: 'CE1141',
colors: ['CE1141', '000000', 'A1A1A4'],
},
{
abbr: 'UTA',
conference: 'Western',
division: 'Northwest',
city: 'Utah',
name: 'Jazz',
color: '002B5C',
colors: ['002B5C', '00471B', 'F9A01B'],
},
{
abbr: 'WAS',
conference: 'Eastern',
division: 'Southeast',
city: 'Washington',
name: 'Wizards',
color: '002B5C',
colors: ['002B5C', 'E31837', 'C4CED4'],
},
];

export default NBALeagueData;

0 comments on commit c14dde2

Please sign in to comment.