Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFA.Cover.getMultiple doesn't work #48

Closed
c0d3rman opened this issue Oct 9, 2021 · 3 comments
Closed

MFA.Cover.getMultiple doesn't work #48

c0d3rman opened this issue Oct 9, 2021 · 3 comments

Comments

@c0d3rman
Copy link

c0d3rman commented Oct 9, 2021

When making a request to get many covers using MFA.Cover.getMultiple, I get this as a response:
APIRequestError: Returned HTML error page [object Object]
I can provide more details if necessary.

@md-y
Copy link
Owner

md-y commented Oct 10, 2021

I can't replicate the issue. What exactly are you doing?

@c0d3rman
Copy link
Author

Here's a minimal example that replicates the issue:

const MFA = require('mangadex-full-api');

MFA.login('username', 'password', '.mangadex_search_cache').then(async () => {
    let results = await MFA.Manga.search({
        includedTags: ['ace04997-f6bd-436e-b261-779182193d3d'], // Isekai
        availableTranslatedLanguage: ['en'],
        limit: Infinity
    });

    let covers = await MFA.Cover.getMultiple(results.map(manga => manga.mainCover.id));
}).catch(console.error);

@md-y
Copy link
Owner

md-y commented Oct 17, 2021

let covers = await MFA.Cover.getMultiple(results.map(manga => manga.mainCover.id));

Should Be:

let covers = await MFA.Cover.getMultiple(...results.map(manga => manga.mainCover.id));

However I'll make it so next version spread operators will flatten arrays so this doesn't happen

@md-y md-y closed this as completed Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants