Skip to content

Commit

Permalink
feat(orgs) : add pagination support
Browse files Browse the repository at this point in the history
  • Loading branch information
samiFakhfakhScalingo committed Dec 19, 2024
1 parent b42fbe0 commit 530411b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SCMIntegrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions src/models/auth/scm_integrations.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PaginationMeta } from "src/meta";

import { User } from "./user";

/**
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 530411b

Please sign in to comment.