2018-08-26 21:16:00 +00: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 04:42:57 +00:00
|
|
|
return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
|
2018-08-26 21:16:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function unblockDomain (instanceName, accessToken, domain) {
|
|
|
|
let url = `${basename(instanceName)}/api/v1/domain_blocks?${paramsString({ domain })}`
|
2018-08-30 04:42:57 +00:00
|
|
|
return del(url, auth(accessToken), { timeout: WRITE_TIMEOUT })
|
2018-08-26 21:16:00 +00:00
|
|
|
}
|