feat: add watchlist patch with limitations

This commit is contained in:
Maël Gangloff
2024-08-14 23:23:32 +02:00
parent d41071a052
commit 5dd27a4b7b
4 changed files with 82 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
import {Event, request, Watchlist} from "./index";
import {request, Watchlist} from "./index";
export async function getWatchlists() {
const response = await request({
@@ -32,3 +32,15 @@ export async function deleteWatchlist(token: string): Promise<void> {
url: 'watchlists/' + token
})
}
export async function patchWatchlist(watchlist: Partial<Watchlist> & { token: string }) {
const response = await request<Watchlist>({
method: 'PATCH',
url: 'watchlists/' + watchlist.token,
data: watchlist,
headers: {
"Content-Type": 'application/merge-patch+json'
}
})
return response.data
}