Skip to content

Commit

Permalink
feat: fix bug in org and token's owner handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Mar 13, 2024
1 parent 73c3805 commit 9ce13a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class OrganizationSDK {

return (await this.request.get('/get-organizations', {
params: {
owner: this.config.orgName,
owner: 'admin',
},
})) as unknown as Promise<AxiosResponse<{ data: Organization[] }>>
}
Expand All @@ -90,7 +90,7 @@ export class OrganizationSDK {

return (await this.request.get('/get-organization', {
params: {
id: `${this.config.orgName}/${id}`,
id: `admin/${id}`,
},
})) as unknown as Promise<AxiosResponse<{ data: Organization }>>
}
Expand All @@ -101,7 +101,7 @@ export class OrganizationSDK {
}

const url = `/${method}`
organization.owner = this.config.orgName
organization.owner = 'admin'
return (await this.request.post(url, organization, {
params: {
id: `${organization.owner}/${organization.name}`,
Expand Down
6 changes: 3 additions & 3 deletions src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class TokenSDK {
params: {
p: String(p),
pageSize: String(pageSize),
owner: this.config.orgName,
owner: 'admin',
},
})) as unknown as Promise<AxiosResponse<{ data: Token[] }>>
}
Expand All @@ -66,7 +66,7 @@ export class TokenSDK {

return (await this.request.get('/get-token', {
params: {
id: `${this.config.orgName}/${id}`,
id: `admin/${id}`,
},
})) as unknown as Promise<AxiosResponse<{ data: Token }>>
}
Expand All @@ -77,7 +77,7 @@ export class TokenSDK {
}

const url = `/${method}`
token.owner = this.config.orgName
token.owner = 'admin'
return (await this.request.post(url, token, {
params: {
id: `${token.owner}/${token.name}`,
Expand Down

0 comments on commit 9ce13a8

Please sign in to comment.