Pinafore-Web-Client-Frontend/src/routes/_actions/reportStatuses.js

14 lines
473 B
JavaScript
Raw Normal View History

import { store } from '../_store/store'
import { toast } from '../_components/toast/toast'
import { report } from '../_api/report'
export async function reportStatuses (account, statusIds, comment, forward) {
2019-08-03 22:49:37 +02:00
const { currentInstance, accessToken } = store.get()
try {
await report(currentInstance, accessToken, account.id, statusIds, comment, forward)
toast.say('Submitted report')
} catch (e) {
toast.say('Failed to report: ' + (e.message || ''))
}
}