Skip to content

Commit

Permalink
Merge pull request #89 from multinet-app/session-object
Browse files Browse the repository at this point in the history
Require that session states be objects
  • Loading branch information
JackWilb authored Aug 11, 2023
2 parents d9c9b62 + 29508bc commit 0fe3da5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface MultinetAxiosInstance extends AxiosInstance {
createSession(workspace: string, itemId: number, type: 'network' | 'table', visApp: string, name: string): AxiosPromise<any>;
listSessions(workspace: string, type: 'network' | 'table'): AxiosPromise<any>;
deleteSession(workspace: string, sessionId: number, type: 'network' | 'table'): Promise<any>;
updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: string): AxiosPromise<any>;
updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise<any>;
renameSession(workspace: string, sessionId: number, type: 'network' | 'table', name: string): AxiosPromise<any>;
getSession(workspace: string, sessionId: number, type: 'network' | 'table'): AxiosPromise<any>;
}
Expand Down Expand Up @@ -252,7 +252,7 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios
return this.delete(`workspaces/${workspace}/sessions/${type}/${sessionId}/`);
};

Proto.updateSession = function(workspace: string, sessionId: number, type: 'network' | 'table', state: string): AxiosPromise<any> {
Proto.updateSession = function(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise<any> {
return this.patch(`workspaces/${workspace}/sessions/${type}/${sessionId}/state/`, {
state,
});
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class MultinetAPI {
return (await this.axios.deleteSession(workspace, sessionId, type)).data;
}

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

Expand Down

0 comments on commit 0fe3da5

Please sign in to comment.