pinafore/routes/_api/pin.js
Nolan Lawson 8089202977
add ability to pin and unpin statuses (#235)
* add ability to pin and unpin statuses

* add another test
2018-04-29 12:28:44 -07:00

13 lines
498 B
JavaScript

import { postWithTimeout } from '../_utils/ajax'
import { auth, basename } from './utils'
export async function pinStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/pin`
return postWithTimeout(url, null, auth(accessToken))
}
export async function unpinStatus (instanceName, accessToken, statusId) {
let url = `${basename(instanceName)}/api/v1/statuses/${statusId}/unpin`
return postWithTimeout(url, null, auth(accessToken))
}