aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
index 7556010..d4c2ab8 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
@@ -253,11 +253,11 @@ function CreateGroupWizard({ token, username, onCreated, onNodeLinked, allowPubl
const mainRoot = roots[0];
const attachBody = {
name: name.trim(),
- shared_dir: mainRoot.path,
+ path: mainRoot.path,
writable: mainRoot.writable !== false,
};
- await platform.node.call('POST', '/api/groups/attach', attachBody);
- await platform.node.call('POST', '/api/reload');
+ await platform.node.op('attachGroup', attachBody);
+ await platform.node.op('reload');
update('done');
advance();
@@ -272,8 +272,9 @@ function CreateGroupWizard({ token, username, onCreated, onNodeLinked, allowPubl
update('running');
for (let i = 1; i < roots.length; i++) {
const r = roots[i];
- await withRetry(() => platform.node.call('POST', `/api/groups/${gid}/roots`, {
- path: r.path, name: r.name, writable: !!r.writable, removable: !!r.removable,
+ await withRetry(() => platform.node.op('addRoot', {
+ groupId: gid, path: r.path, name: r.name,
+ writable: !!r.writable, removable: !!r.removable,
}));
}
await platform.waitForRootsIndexed(gid, setIndexProgress);
@@ -283,20 +284,20 @@ function CreateGroupWizard({ token, username, onCreated, onNodeLinked, allowPubl
// 5. GEK init
update('running');
- await withRetry(() => platform.node.call('POST', `/api/groups/${gid}/gek`));
+ await withRetry(() => platform.node.op('initGek', { groupId: gid }));
update('done');
advance();
// 6. Generate pairing code
update('running');
- const pairResult = await platform.node.call('POST', '/api/operator/pair');
+ const pairResult = await platform.node.op('pairOperator');
if (pairResult && pairResult.code) {
await platform.node.setPairingCode(pairResult.code);
session.pendingJoinCode = pairResult.code;
}
update('done');
- try { await platform.node.call('POST', '/api/reload'); } catch { /* best effort */ }
+ try { await platform.node.op('reload'); } catch { /* best effort */ }
setStep(3);
if (onCreated) onCreated();