1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Partial fix #495

Add delete list
Also trying out new context menu
This commit is contained in:
xmflsct
2022-11-30 23:47:05 +01:00
parent bb3ddd2779
commit 0cc1cdd4b6
7 changed files with 461 additions and 12 deletions

View File

@ -26,6 +26,10 @@ type MutationVarsLists =
type: 'edit'
payload: Mastodon.List
}
| {
type: 'delete'
payload: Pick<Mastodon.List, 'id'>
}
const mutationFunction = async (params: MutationVarsLists) => {
const body = new FormData()
@ -48,6 +52,11 @@ const mutationFunction = async (params: MutationVarsLists) => {
url: `lists/${params.payload.id}`,
body
}).then(res => res.body)
case 'delete':
return apiInstance({
method: 'delete',
url: `lists/${params.payload.id}`
})
}
}