feat(TALE-4): make acl tags editable from the menu

This commit is contained in:
Aarnav Tale 2024-07-07 14:20:39 -04:00
parent fe40a5734e
commit 7804d83181
No known key found for this signature in database
3 changed files with 182 additions and 2 deletions

View file

@ -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,