semaphore/routes/_actions/delete.js

15 lines
440 B
JavaScript
Raw Normal View History

2018-03-14 15:36:12 +00:00
import { store } from '../_store/store'
import { deleteStatus } from '../_api/delete'
import { toast } from '../_utils/toast'
export async function doDeleteStatus (statusId) {
let { currentInstance, accessToken } = store.get()
2018-03-14 15:36:12 +00:00
try {
await deleteStatus(currentInstance, accessToken, statusId)
2018-03-14 15:36:12 +00:00
toast.say('Status deleted.')
} catch (e) {
console.error(e)
toast.say('Unable to delete status: ' + (e.message || ''))
}
}