-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Separate Resource keys for simplicity and maintenancee
- Loading branch information
Showing
7 changed files
with
46 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@blizzard-api/wow': patch | ||
--- | ||
|
||
Shuffle around files a bit and separate resource keys for simplicity and maintenance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Resource } from '@blizzard-api/core'; | ||
import { base, mediaBase } from '../base'; | ||
import type { AchievementCategoryResponse } from './response'; | ||
|
||
const achievementBase = `${base}/achievement`; | ||
const achievementCategoryBase = `${base}/achievement-category`; | ||
|
||
export const achievements = { | ||
achievementCategory: (achievementCategoryId: number): Resource<AchievementCategoryResponse> => { | ||
return { | ||
path: `${achievementCategoryBase}/${achievementCategoryId}`, | ||
namespace: 'static', | ||
}; | ||
}, | ||
achievementCategoryIndex: (): Resource => { | ||
return { | ||
path: `${achievementCategoryBase}/index`, | ||
namespace: 'static', | ||
}; | ||
}, | ||
achievement: (achievementId: number): Resource => { | ||
return { | ||
path: `${achievementBase}/${achievementId}`, | ||
namespace: 'static', | ||
}; | ||
}, | ||
achievementIndex: (): Resource => { | ||
return { | ||
path: `${achievementBase}/index`, | ||
namespace: 'static', | ||
}; | ||
}, | ||
media: (achievementId: number): Resource => { | ||
return { path: `${mediaBase}/achievement/${achievementId}`, namespace: 'static' }; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface AchievementCategoryResponse { | ||
id: number; | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { gameDataApi } from './game-data'; | ||
import { achievements } from './achievements'; | ||
|
||
export const wow = { | ||
...gameDataApi, | ||
...achievements, | ||
}; |