fix(TALE-35): use the correct machine registry endpoint

This commit is contained in:
Aarnav Tale 2024-10-10 11:12:35 -04:00
parent d165264876
commit ecef45c98a
No known key found for this signature in database
3 changed files with 48 additions and 17 deletions

View file

@ -114,13 +114,24 @@ export async function menuAction(request: ActionFunctionArgs['request']) {
}
try {
await post('v1/node/register', session.get('hsApiKey')!, {
const qp = new URLSearchParams()
qp.append('user', user)
qp.append('key', key)
const url = `v1/node/register?${qp.toString()}`
await post(url, session.get('hsApiKey')!, {
user, key,
})
return json({ message: 'Machine registered' })
return json({
success: true,
message: 'Machine registered'
})
} catch {
return json({ message: 'Failed to register machine' }, {
return json({
success: false,
message: 'Failed to register machine'
}, {
status: 500,
})
}