Skip to content

Commit

Permalink
feat(platfrom): add delete method in api client (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriptonian1 authored May 18, 2024
1 parent d41605c commit 55cf09f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions apps/platform/src/lib/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ class APIClient {
credentials: 'include'
})
}

/**
* Sends a DELETE request to the specified URL and returns a Promise that resolves to the response data.
*
* @param url - The URL to send the DELETE request to.
* @returns A Promise that resolves to the response data.
*/
delete<T>(url: string): Promise<T> {
return this.request<T>(url, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include'
})
}
}

export const apiClient = new APIClient(
Expand Down

0 comments on commit 55cf09f

Please sign in to comment.