Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rest-api-client): rename moveToSpace method to move #2872

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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