feat(TALE-4): make acl tags editable from the menu
This commit is contained in:
parent
fe40a5734e
commit
7804d83181
3 changed files with 182 additions and 2 deletions
|
|
@ -80,6 +80,23 @@ export async function menuAction(request: ActionFunctionArgs['request']) {
|
|||
}
|
||||
}
|
||||
|
||||
case 'tags': {
|
||||
const tags = data.get('tags')?.toString()
|
||||
.split(',') ?? []
|
||||
|
||||
try {
|
||||
await post(`v1/node/${id}/tags`, session.get('hsApiKey')!, {
|
||||
tags,
|
||||
})
|
||||
|
||||
return json({ message: 'Tags updated' })
|
||||
} catch {
|
||||
return json({ message: 'Failed to update tags' }, {
|
||||
status: 500,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
default: {
|
||||
return json({ message: 'Invalid method' }, {
|
||||
status: 400,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue