mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add watchlist patch with limitations
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user