Skip to content

Commit

Permalink
Fix web api client (#3779)
Browse files Browse the repository at this point in the history
  • Loading branch information
anbraten authored Jun 10, 2024
1 parent 7cae6e5 commit 9bc15a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/lib/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class ApiClient {
this.csrf = csrf;
}

private async _request(method: string, path: string, data: unknown): Promise<unknown> {
private async _request(method: string, path: string, data?: unknown): Promise<unknown> {
const res = await fetch(`${this.server}${path}`, {
method,
headers: {
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class ApiClient {
}

_get(path: string) {
return this._request('GET', path, null);
return this._request('GET', path);
}

_post(path: string, data?: unknown) {
Expand All @@ -83,7 +83,7 @@ export default class ApiClient {
}

_delete(path: string) {
return this._request('DELETE', path, null);
return this._request('DELETE', path);
}

_subscribe<T>(path: string, callback: (data: T) => void, opts = { reconnect: true }) {
Expand Down

0 comments on commit 9bc15a5

Please sign in to comment.