mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-28 07:20:49 -04:00
#292 [api] add /pronouns-name
This commit is contained in:
parent
678e7125f8
commit
0f22481535
@ -49,8 +49,17 @@ router.get('/pronouns/:pronoun*', handleErrorAsync(async (req, res) => {
|
|||||||
);
|
);
|
||||||
if (pronoun) {
|
if (pronoun) {
|
||||||
pronoun.examples = addExamples(pronoun, requestExamples(req.query.examples))
|
pronoun.examples = addExamples(pronoun, requestExamples(req.query.examples))
|
||||||
|
pronoun.name = pronoun.name();
|
||||||
}
|
}
|
||||||
return res.json(pronoun);
|
return res.json(pronoun);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
router.get('/pronouns-name/:pronoun*', handleErrorAsync(async (req, res) => {
|
||||||
|
const pronoun = buildPronoun(
|
||||||
|
parsePronouns(loadTsv('pronouns/pronouns')),
|
||||||
|
req.params.pronoun + req.params[0],
|
||||||
|
);
|
||||||
|
return res.json(pronoun.name());
|
||||||
|
}));
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user