Skip to content

Commit 0fe3da5

Browse files
authored
Merge pull request #89 from multinet-app/session-object
Require that session states be objects
2 parents d9c9b62 + 29508bc commit 0fe3da5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/axios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export interface MultinetAxiosInstance extends AxiosInstance {
7070
createSession(workspace: string, itemId: number, type: 'network' | 'table', visApp: string, name: string): AxiosPromise<any>;
7171
listSessions(workspace: string, type: 'network' | 'table'): AxiosPromise<any>;
7272
deleteSession(workspace: string, sessionId: number, type: 'network' | 'table'): Promise<any>;
73-
updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: string): AxiosPromise<any>;
73+
updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise<any>;
7474
renameSession(workspace: string, sessionId: number, type: 'network' | 'table', name: string): AxiosPromise<any>;
7575
getSession(workspace: string, sessionId: number, type: 'network' | 'table'): AxiosPromise<any>;
7676
}
@@ -252,7 +252,7 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios
252252
return this.delete(`workspaces/${workspace}/sessions/${type}/${sessionId}/`);
253253
};
254254

255-
Proto.updateSession = function(workspace: string, sessionId: number, type: 'network' | 'table', state: string): AxiosPromise<any> {
255+
Proto.updateSession = function(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise<any> {
256256
return this.patch(`workspaces/${workspace}/sessions/${type}/${sessionId}/state/`, {
257257
state,
258258
});

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class MultinetAPI {
273273
return (await this.axios.deleteSession(workspace, sessionId, type)).data;
274274
}
275275

276-
public async updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: string): Promise<any> {
276+
public async updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: object): Promise<any> {
277277
return (await this.axios.updateSession(workspace, sessionId, type, state)).data;
278278
}
279279

0 commit comments

Comments
 (0)