Skip to content

Commit

Permalink
fix(rest-api-client): rename moveToSpace method to move (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
shabaraba authored Jul 12, 2024
1 parent 2104de6 commit ca902a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
6 changes: 2 additions & 4 deletions examples/rest-api-client-demo/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,9 @@ export class App {
}
}

public async moveToSpace() {
public async move() {
try {
console.log(
await this.client.app.moveToSpace({ app: APP_ID, space: SPACE_ID }),
);
console.log(await this.client.app.move({ app: APP_ID, space: SPACE_ID }));
} catch (error) {
console.log(error);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/rest-api-client/docs/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- [updateReports](#updateReports)
- [getAppActions](#getAppActions)
- [updateAppActions](#updateAppActions)
- [moveToSpace](#moveToSpace)
- [move](#move)
- [getPlugins](#getPlugins)

## Overview
Expand Down Expand Up @@ -1356,7 +1356,7 @@ Updates the [Action](https://get.kintone.help/k/en/user/app_settings/appaction/s

- https://kintone.dev/en/docs/kintone/rest-api/apps/update-action-settings/

### moveToSpace
### move

Changes the Space to which an App belongs.

Expand Down
5 changes: 1 addition & 4 deletions packages/rest-api-client/src/client/AppClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,7 @@ export class AppClient extends BaseClient {
return this.client.put(path, params);
}

public moveToSpace(params: {
app: AppID;
space: SpaceID | null;
}): Promise<{}> {
public move(params: { app: AppID; space: SpaceID | null }): Promise<{}> {
const path = this.buildPath({
endpointName: "app/move",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ describe("AppClient", () => {
});
});

describe("AppClient: moveToSpace", () => {
describe("AppClient: move", () => {
let mockClient: MockClient;
let appClient: AppClient;

Expand All @@ -1324,10 +1324,10 @@ describe("AppClient: moveToSpace", () => {
mockClient = buildMockClient(requestConfigBuilder);
appClient = new AppClient(mockClient);
});
describe("moveToSpace", () => {
describe("move", () => {
const params = { app: APP_ID, space: 1 } as const;
beforeEach(async () => {
await appClient.moveToSpace(params);
await appClient.move(params);
});
it("should pass the path to the http client", () => {
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/move.json");
Expand Down

0 comments on commit ca902a7

Please sign in to comment.