mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(api) fix routes parsing pronouns
introduced in 118ea121dee99dd368d4d8737d3b15c80eb1de88
This commit is contained in:
parent
da63c33e23
commit
3896053a33
@ -86,7 +86,7 @@ router.get('/banner/:pronounName*.png', handleErrorAsync(async (req, res) => {
|
||||
}
|
||||
|
||||
const pronoun = buildPronoun(
|
||||
parsePronouns(loadTsv(`${__dirname}/../../data/pronouns/pronouns.tsv`)),
|
||||
parsePronouns(global.config, loadTsv(`${__dirname}/../../data/pronouns/pronouns.tsv`)),
|
||||
pronounName,
|
||||
global.config,
|
||||
translator,
|
||||
|
@ -44,7 +44,7 @@ const addExamples = (pronoun, examples) => {
|
||||
const router = Router();
|
||||
|
||||
router.get('/pronouns', handleErrorAsync(async (req, res) => {
|
||||
const pronouns = parsePronouns(loadTsv('pronouns/pronouns'));
|
||||
const pronouns = parsePronouns(global.config, loadTsv('pronouns/pronouns'));
|
||||
for (const pronoun in pronouns) {
|
||||
if (!pronouns.hasOwnProperty(pronoun)) {
|
||||
continue;
|
||||
@ -56,7 +56,7 @@ router.get('/pronouns', handleErrorAsync(async (req, res) => {
|
||||
|
||||
router.get('/pronouns/:pronoun*', handleErrorAsync(async (req, res) => {
|
||||
const pronoun = buildPronoun(
|
||||
parsePronouns(loadTsv('pronouns/pronouns')),
|
||||
parsePronouns(global.config, loadTsv('pronouns/pronouns')),
|
||||
req.params.pronoun + req.params[0],
|
||||
global.config,
|
||||
translator,
|
||||
@ -70,7 +70,7 @@ router.get('/pronouns/:pronoun*', handleErrorAsync(async (req, res) => {
|
||||
|
||||
router.get('/pronouns-name/:pronoun*', handleErrorAsync(async (req, res) => {
|
||||
const pronoun = buildPronoun(
|
||||
parsePronouns(loadTsv('pronouns/pronouns')),
|
||||
parsePronouns(global.config, loadTsv('pronouns/pronouns')),
|
||||
(req.params.pronoun + req.params[0]).toLowerCase(),
|
||||
global.config,
|
||||
translator,
|
||||
|
Loading…
x
Reference in New Issue
Block a user