From 530411bcaaed7f450f9da85b839ccc1cb0a8da5f Mon Sep 17 00:00:00 2001 From: Sami Fakhfakh Date: Thu, 19 Dec 2024 14:25:01 +0100 Subject: [PATCH] feat(orgs) : add pagination support --- src/SCMIntegrations/index.ts | 3 ++- src/models/auth/scm_integrations.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SCMIntegrations/index.ts b/src/SCMIntegrations/index.ts index 50f6ec50..87fde7ac 100644 --- a/src/SCMIntegrations/index.ts +++ b/src/SCMIntegrations/index.ts @@ -6,6 +6,7 @@ import { Repository, Organization, Branch, + OrganizationsMeta, } from "../models/auth/scm_integrations"; import { CreateParams } from "../params/auth/scm_integrations"; import { unpackData } from "../utils"; @@ -147,7 +148,7 @@ export default class SCMIntegrations { integrationID: string, page: number = 1, per_page: number = 20, - ): Promise<{ organizations: Organization[]; more: boolean }> { + ): Promise<{ organizations: Organization[]; meta: OrganizationsMeta }> { return unpackData( this._client .authApiClient() diff --git a/src/models/auth/scm_integrations.ts b/src/models/auth/scm_integrations.ts index daf8e982..245d4596 100644 --- a/src/models/auth/scm_integrations.ts +++ b/src/models/auth/scm_integrations.ts @@ -1,3 +1,5 @@ +import { PaginationMeta } from "src/meta"; + import { User } from "./user"; /** @@ -81,6 +83,10 @@ export interface Organization { url: string; } +export interface OrganizationsMeta { + pagination: PaginationMeta; +} + /** @see https://developers.scalingo.com/scm_repo_link */ export interface Branch { /** Name of the branch */