mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: user can enable/disable a watchlist
This commit is contained in:
@@ -84,6 +84,7 @@ export interface WatchlistRequest {
|
||||
trackedEppStatus?: string[]
|
||||
connector?: string
|
||||
dsn?: string[]
|
||||
enabled?: boolean
|
||||
}
|
||||
|
||||
export interface Watchlist {
|
||||
@@ -100,6 +101,7 @@ export interface Watchlist {
|
||||
createdAt: string
|
||||
}
|
||||
createdAt: string
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export interface InstanceConfig {
|
||||
|
||||
@@ -32,6 +32,18 @@ export async function postWatchlist(watchlist: WatchlistRequest) {
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function patchWatchlist(token: string, watchlist: Partial<WatchlistRequest>) {
|
||||
const response = await request<{ token: string }>({
|
||||
method: 'PATCH',
|
||||
url: 'watchlists/' + token,
|
||||
data: watchlist,
|
||||
headers: {
|
||||
'Content-Type': 'application/merge-patch+json'
|
||||
}
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function deleteWatchlist(token: string): Promise<void> {
|
||||
await request({
|
||||
method: 'DELETE',
|
||||
|
||||
Reference in New Issue
Block a user