mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
fix DeepLX
`??` binds tighter than `? :`, so that expression was parsed as: ```ts ( deeplFreeInstance ?? this.serverSettings.deeplIsPro ) ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate' ``` which ended up calling the non-free DeepL instead of the local DeepLX
This commit is contained in:
parent
c1af8dfb7f
commit
b13781632f
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (this.serverSettings.deeplAuthKey) params.append('auth_key', this.serverSettings.deeplAuthKey);
|
||||
params.append('text', note.text);
|
||||
params.append('target_lang', targetLang);
|
||||
const endpoint = deeplFreeInstance ?? this.serverSettings.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate';
|
||||
const endpoint = deeplFreeInstance ?? ( this.serverSettings.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate' );
|
||||
|
||||
const res = await this.httpRequestService.send(endpoint, {
|
||||
method: 'POST',
|
||||
|
|
Loading…
Add table
Reference in a new issue