Check aliases instead of name directly

This commit is contained in:
Vrganj 2021-01-16 00:59:25 +01:00
parent e80bb0372b
commit 420a104f5c
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ app.post(
errorMessage: 'Supplied language is not a string',
},
custom: {
options: value => languages.find(language => language.name === value?.toLowerCase()),
options: value => languages.find(language => language.aliases.includes(value?.toLowerCase())),
errorMessage: 'Supplied language is not supported by Piston',
},
},