1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-13 10:48:19 +01:00
Pinafore-Web-Client-Frontend/routes/_actions/delete.js
Nolan Lawson 8d5690d63d
remove get() with string from Svelte calls (#169)
* remove get() with string pt 1

* remove get() with string pt 2

* fix typo

* fix some null exceptions in get()

* fixup code style
2018-04-19 09:37:05 -07:00

15 lines
440 B
JavaScript

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()
try {
await deleteStatus(currentInstance, accessToken, statusId)
toast.say('Status deleted.')
} catch (e) {
console.error(e)
toast.say('Unable to delete status: ' + (e.message || ''))
}
}