pinafore/src/routes/_api/mute.js

13 wiersze
584 B
JavaScript

import { auth, basename } from './utils.js'
import { post, WRITE_TIMEOUT } from '../_utils/ajax.js'
2018-04-15 05:18:48 +00:00
export async function muteAccount (instanceName, accessToken, accountId, notifications) {
2019-08-03 20:49:37 +00:00
const url = `${basename(instanceName)}/api/v1/accounts/${accountId}/mute`
return post(url, { notifications }, auth(accessToken), { timeout: WRITE_TIMEOUT })
2018-04-15 05:18:48 +00:00
}
export async function unmuteAccount (instanceName, accessToken, accountId) {
2019-08-03 20:49:37 +00:00
const url = `${basename(instanceName)}/api/v1/accounts/${accountId}/unmute`
return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
2018-04-15 05:18:48 +00:00
}