diff --git a/src/services/cardService.ts b/src/services/cardService.ts index 362a7da..e483170 100644 --- a/src/services/cardService.ts +++ b/src/services/cardService.ts @@ -2,27 +2,22 @@ import { Query } from "../interfaces/query"; import { Card } from "../interfaces/card"; import { Client } from "../client"; -export default { - findCardByID: async function (id: string): Promise { - const client: Client = Client.getInstance(); - const response: Card = await client.get('cards', id); - return response; - }, +export async function findCardByID(id: string): Promise { + const client: Client = Client.getInstance(); + const response: Card = await client.get('cards', id); + return response; +} - getAllCards: async function (): Promise { - const params: Query[] = [{ - name: 'pageSize', - value: 250, - }]; +export async function findCardsByQueries(params: Query[]): Promise { + const client: Client = Client.getInstance(); + const response: Card[] = await client.get('cards', params); + return response; +} - const client: Client = Client.getInstance(); - const response: Card[] = await client.get('cards', params); - return response; - }, +export async function getAllCards(): Promise { + const param: string = 'pageSize:250' - findCardByQueries: async function(params: Query[]): Promise { - const client: Client = Client.getInstance(); - const response: Card[] = await client.get('cards', params); - return response; - } + const client: Client = Client.getInstance(); + const response: Card[] = await client.get('cards', param); + return response; } \ No newline at end of file