Skip to content

Commit

Permalink
Refactored API access.
Browse files Browse the repository at this point in the history
  • Loading branch information
RillingDev committed Nov 1, 2022
1 parent a2f0597 commit 5a77991
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/ygoprodeck/api/PaginatedResponse.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* eslint-disable @typescript-eslint/naming-convention */

export interface PaginatedResponse<T> {
data: T;
meta: {
current_rows: number;
total_rows: number;
rows_remaining: number;
total_pages: number;
pages_remaining: number;
previous_page?: string;
previous_page_offset?: number;
next_page?: string;
next_page_offset?: number;
readonly data: T;
readonly meta: {
readonly current_rows: number;
readonly total_rows: number;
readonly rows_remaining: number;
readonly total_pages: number;
readonly pages_remaining: number;
readonly previous_page?: string;
readonly previous_page_offset?: number;
readonly next_page?: string;
readonly next_page_offset?: number;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/ygoprodeck/api/YgoprodeckApiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class YgoprodeckApiService {
if (
res.status === YgoprodeckApiService.HTTP_STATUS_NO_MATCHES
) {
return Promise.resolve(createEmptyPaginatedResponse([]));
return createEmptyPaginatedResponse([]);
}
assertStatusOk(res);
return res.json() as Promise<PaginatedResponse<RawCard[]>>;
Expand Down

0 comments on commit 5a77991

Please sign in to comment.