[bug] make remote-pronouns-name lowercase
This commit is contained in:
parent
ae4823ce87
commit
84b77dcb30
|
@ -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);
|
||||||
|
|
|
@ -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) => {
|
||||||
|
|
Reference in New Issue