2018-08-26 23:16:00 +02:00
|
|
|
import { post, WRITE_TIMEOUT, paramsString, del } from '../_utils/ajax'
|
|
|
|
import { auth, basename } from './utils'
|
|
|
|
|
|
|
|
export async function blockDomain (instanceName, accessToken, domain) {
|
|
|
|
let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}`
|
2018-08-30 06:42:57 +02:00
|
|
|
return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
|
2018-08-26 23:16:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function unblockDomain (instanceName, accessToken, domain) {
|
|
|
|
let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}`
|
2018-08-30 06:42:57 +02:00
|
|
|
return del(url, auth(accessToken), { timeout: WRITE_TIMEOUT })
|
2018-08-26 23:16:00 +02:00
|
|
|
}
|