-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(routes): Add in 2014 routes and move controllers
- Loading branch information
Showing
93 changed files
with
272 additions
and
186 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
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,4 @@ | ||
import AbilityScore from '../../../models/2014/abilityScore/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(AbilityScore); |
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,4 @@ | ||
import Alignment from '../../../models/2014/alignment/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Alignment); |
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,4 @@ | ||
import Background from '../../../models/2014/background/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Background); |
18 changes: 9 additions & 9 deletions
18
src/controllers/api/classController.ts → src/controllers/api/2014/classController.ts
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
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,4 @@ | ||
import Condition from '../../../models/2014/condition/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Condition); |
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,4 @@ | ||
import DamageType from '../../../models/2014/damageType/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(DamageType); |
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,4 @@ | ||
import EquipmentCategory from '../../../models/2014/equipmentCategory/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(EquipmentCategory); |
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,4 @@ | ||
import Equipment from '../../../models/2014/equipment/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Equipment); |
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,4 @@ | ||
import Feat from '../../../models/2014/feat/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Feat); |
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,4 @@ | ||
import Feature from '../../../models/2014/feature/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Feature); |
2 changes: 1 addition & 1 deletion
2
src/controllers/api/imageController.ts → src/controllers/api/2014/imageController.ts
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
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,4 @@ | ||
import Language from '../../../models/2014/language/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Language); |
4 changes: 2 additions & 2 deletions
4
src/controllers/api/magicItemController.ts → ...ntrollers/api/2014/magicItemController.ts
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
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,4 @@ | ||
import MagicSchool from '../../../models/2014/magicSchool/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(MagicSchool); |
4 changes: 2 additions & 2 deletions
4
src/controllers/api/monsterController.ts → ...controllers/api/2014/monsterController.ts
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
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,4 @@ | ||
import Proficiency from '../../../models/2014/proficiency/index.js'; | ||
import SimpleController from '../../simpleController.js'; | ||
|
||
export default new SimpleController(Proficiency); |
12 changes: 6 additions & 6 deletions
12
src/controllers/api/raceController.ts → src/controllers/api/2014/raceController.ts
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
4 changes: 2 additions & 2 deletions
4
src/controllers/api/ruleController.ts → src/controllers/api/2014/ruleController.ts
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
4 changes: 2 additions & 2 deletions
4
src/controllers/api/ruleSectionController.ts → ...rollers/api/2014/ruleSectionController.ts
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
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,4 @@ | ||
import SimpleController from '../../simpleController.js'; | ||
import Skill from '../../../models/2014/skill/index.js'; | ||
|
||
export default new SimpleController(Skill); |
4 changes: 2 additions & 2 deletions
4
src/controllers/api/spellController.ts → src/controllers/api/2014/spellController.ts
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
10 changes: 5 additions & 5 deletions
10
src/controllers/api/subclassController.ts → ...ontrollers/api/2014/subclassController.ts
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
10 changes: 5 additions & 5 deletions
10
src/controllers/api/subraceController.ts → ...controllers/api/2014/subraceController.ts
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
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,4 @@ | ||
import SimpleController from '../../simpleController.js'; | ||
import Trait from '../../../models/2014/trait/index.js'; | ||
|
||
export default new SimpleController(Trait); |
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,4 @@ | ||
import SimpleController from '../../simpleController.js'; | ||
import WeaponProperty from '../../../models/2014/weaponProperty/index.js'; | ||
|
||
export default new SimpleController(WeaponProperty); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Request, Response, NextFunction } from 'express'; | ||
import Collection from '../../models/2014/collection/index.js'; | ||
|
||
export const index = async (req: Request, res: Response, next: NextFunction) => { | ||
try { | ||
const data = await Collection.find({}) | ||
.select({ index: 1, _id: 0 }) | ||
.sort({ index: 'asc' }) | ||
.exec(); | ||
|
||
const apiIndex: Record<string, string> = {}; | ||
data.forEach((item) => { | ||
if (item.index === 'levels') return; | ||
|
||
apiIndex[item.index] = `/api/2014/${item.index}`; | ||
}); | ||
|
||
return res.status(200).json(apiIndex); | ||
} catch (err) { | ||
next(err); | ||
} | ||
}; |
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
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
Oops, something went wrong.