[bug] make remote-pronouns-name lowercase

This commit is contained in:
Andrea 2022-04-12 20:35:13 +02:00
parent ae4823ce87
commit 84b77dcb30
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ export default {
try { try {
const pronounName = await this.$axios.$get(`/remote-pronouns-name/${this.locale}/${this.pronounWithoutDomain}`); const pronounName = await this.$axios.$get(`/remote-pronouns-name/${this.locale}/${this.pronounWithoutDomain}`);
if (!pronounName.startsWith('<!doctype') && pronounName.length < 36) { if (!pronounName.startsWith('<!doctype') && pronounName.length < 36) {
this.pronounName = pronounName; this.pronounName = pronounName.toLowerCase();
} }
} catch (e) { } catch (e) {
console.error(e); console.error(e);

View File

@ -61,12 +61,12 @@ router.get('/pronouns/:pronoun*', handleErrorAsync(async (req, res) => {
router.get('/pronouns-name/:pronoun*', handleErrorAsync(async (req, res) => { router.get('/pronouns-name/:pronoun*', handleErrorAsync(async (req, res) => {
const pronoun = buildPronoun( const pronoun = buildPronoun(
parsePronouns(loadTsv('pronouns/pronouns')), parsePronouns(loadTsv('pronouns/pronouns')),
req.params.pronoun + req.params[0], (req.params.pronoun + req.params[0]).toLowerCase(),
); );
if (!pronoun) { if (!pronoun) {
return res.status(404).json({error: 'Not found'}); return res.status(404).json({error: 'Not found'});
} }
return res.json(pronoun.name().toLowerCase()); return res.json(pronoun.name());
})); }));
router.get('/remote-pronouns-name/:locale/:pronoun*', handleErrorAsync(async (req, res) => { router.get('/remote-pronouns-name/:locale/:pronoun*', handleErrorAsync(async (req, res) => {