feat: user can enable/disable a watchlist

This commit is contained in:
Maël Gangloff
2025-10-25 19:23:15 +02:00
parent 5243b3c2dd
commit 24e3bc19ff
13 changed files with 212 additions and 37 deletions

View File

@@ -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 {

View File

@@ -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',