Use private client methods in services

This commit is contained in:
Tee
2021-02-28 22:27:48 -05:00
parent 537a236b42
commit 7f71588138
2 changed files with 13 additions and 7 deletions

View File

@ -5,7 +5,8 @@ import { Client } from "../client";
export class CardService implements APIService<Card> {
async find(id: string): Promise<Card[]> {
const response: Card[] = await Client.get('cards', id);
const client: Client = Client.getInstance();
const response: Card[] = await client.get<Card[]>('cards', id);
return response;
};
@ -15,12 +16,14 @@ export class CardService implements APIService<Card> {
value: 250,
}];
const response: Card[] = await Client.get('cards', params);
const client: Client = Client.getInstance();
const response: Card[] = await client.get<Card[]>('cards', params);
return response;
};
async where(params: Query[]): Promise<Card[]> {
const response: Card[] = await Client.get('cards', params);
return response;
const client: Client = Client.getInstance();
const response: Card[] = await client.get<Card[]>('cards', params);
return response;
};
}

View File

@ -5,7 +5,8 @@ import { Client } from "../client";
export class SetService implements APIService<Set> {
async find(id: string): Promise<Set[]> {
const response: Set[] = await Client.get('sets', id);
const client: Client = Client.getInstance();
const response: Set[] = await client.get<Set[]>('sets', id);
return response;
};
@ -15,12 +16,14 @@ export class SetService implements APIService<Set> {
value: 250,
}];
const response: Set[] = await Client.get('sets', params);
const client: Client = Client.getInstance();
const response: Set[] = await client.get<Set[]>('sets', params);
return response;
};
async where(params: Query[]): Promise<Set[]> {
const response: Set[] = await Client.get('sets', params);
const client: Client = Client.getInstance();
const response: Set[] = await client.get<Set[]>('sets', params);
return response;
};
}