🚑 Hotfix to spread torrent pushing

This commit is contained in:
ajnart
2022-06-21 21:04:21 +02:00
parent 85164d79fc
commit a5f477c19b

View File

@@ -28,7 +28,7 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
password: service.password,
})
.getAllData()
.then((e) => e.torrents.map((torrent) => torrents.push(torrent)))
.then((e) => torrents.push(...e.torrents))
)
);
await Promise.all(
@@ -38,7 +38,7 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
password: 'password' in service ? service.password : '',
})
.getAllData()
.then((e) => e.torrents.map((torrent) => torrents.push(torrent)))
.then((e) => torrents.push(...e.torrents))
)
);
// Map transmissionServices
@@ -50,7 +50,7 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
password: 'password' in service ? service.password : '',
})
.getAllData()
.then((e) => e.torrents.map((torrent) => torrents.push(torrent)))
.then((e) => torrents.push(...e.torrents))
)
);
res.status(200).json(torrents);