Some data handling changes

This commit is contained in:
mProjectsCode 2022-05-04 20:01:06 +02:00
parent 96d74a7732
commit c67a0bf590
12 changed files with 66 additions and 39 deletions

View file

@ -1,5 +1,5 @@
import {APIModel} from './APIModel';
import {APIRequestResult} from './APIRequestResult';
import {MediaTypeModel} from '../models/MediaTypeModel';
export class APIManager {
apis: APIModel[];
@ -8,10 +8,10 @@ export class APIManager {
this.apis = [];
}
async query(query: string, types: string[] = []): Promise<APIRequestResult[]> {
async query(query: string, types: string[] = []): Promise<MediaTypeModel[]> {
console.log('MDB | api manager queried');
let res: APIRequestResult[] = [];
let res: MediaTypeModel[] = [];
for (const api of this.apis) {
if (types.length === 0 || api.hasTypeOverlap(types)) {