Plugin review changes round 2
This commit is contained in:
parent
8b4a50647d
commit
889d51712e
9 changed files with 52 additions and 24 deletions
|
|
@ -46,10 +46,10 @@ export class WikipediaAPI extends APIModel {
|
|||
return ret;
|
||||
}
|
||||
|
||||
async getById(item: MediaTypeModel): Promise<MediaTypeModel> {
|
||||
async getById(id: string): Promise<MediaTypeModel> {
|
||||
console.log(`MDB | api "${this.apiName}" queried by ID`);
|
||||
|
||||
const searchUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=info&pageids=${item.id}&inprop=url&format=json&origin=*`;
|
||||
const searchUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=info&pageids=${encodeURIComponent(id)}&inprop=url&format=json&origin=*`;
|
||||
const fetchData = await fetch(searchUrl);
|
||||
|
||||
if (fetchData.status !== 200) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue