Skip to content

Commit fb043ae

Browse files
committed
fix(backend): Convert all methods of SessionApi to class methods
1 parent e88a067 commit fb043ae

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

packages/backend/src/api/endpoints/SessionApi.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,46 @@ type QueryParams = {
1414
};
1515

1616
export class SessionAPI extends AbstractAPI {
17-
public getSessionList = async (queryParams?: QueryParams) =>
18-
this.request<Session[]>({
17+
public async getSessionList(queryParams?: QueryParams) {
18+
return this.request<Session[]>({
1919
method: 'GET',
2020
path: basePath,
2121
queryParams: queryParams,
2222
});
23+
}
2324

24-
public getSession = async (sessionId: string) => {
25+
public async getSession(sessionId: string) {
2526
this.requireId(sessionId);
2627
return this.request<Session>({
2728
method: 'GET',
2829
path: joinPaths(basePath, sessionId),
2930
});
30-
};
31+
}
3132

32-
public revokeSession = async (sessionId: string) => {
33+
public async revokeSession(sessionId: string) {
3334
this.requireId(sessionId);
3435
return this.request<Session>({
3536
method: 'POST',
3637
path: joinPaths(basePath, sessionId, 'revoke'),
3738
});
38-
};
39+
}
3940

40-
public verifySession = async (sessionId: string, token: string) => {
41+
public async verifySession(sessionId: string, token: string) {
4142
this.requireId(sessionId);
4243
return this.request<Session>({
4344
method: 'POST',
4445
path: joinPaths(basePath, sessionId, 'verify'),
4546
bodyParams: { token },
4647
});
47-
};
48+
}
4849

49-
public getToken = async (sessionId: string, template: string) => {
50+
public async getToken(sessionId: string, template: string) {
5051
this.requireId(sessionId);
5152
return (
5253
(await this.request<Token>({
5354
method: 'POST',
5455
path: joinPaths(basePath, sessionId, 'tokens', template || ''),
5556
})) as any
5657
).jwt;
57-
};
58+
}
5859
}

0 commit comments

Comments
 (0)