🐛 Fix wrong access on properties of widgets and apps in api

This commit is contained in:
Meierschlumpf
2022-12-19 18:17:56 +01:00
parent 383a7fa04b
commit 8fa9cfaccf
7 changed files with 45 additions and 29 deletions

View File

@@ -6,7 +6,7 @@ import { Client } from 'sabnzbd-api';
import { NzbgetHistoryItem } from './nzbget/types';
import { NzbgetClient } from './nzbget/nzbget-client';
import { getConfig } from '../../../../tools/config/getConfig';
import { UsenetHistoryItem } from '../../../../components/Dashboard/Tiles/UseNet/types';
import { UsenetHistoryItem } from '../../../../widgets/useNet/types';
dayjs.extend(duration);
@@ -40,10 +40,8 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
const options = {
host: url.hostname,
port: url.port,
login:
app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash:
app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
login: app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash: app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
};
const nzbGet = NzbgetClient(options);