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