diff --git a/src/member-api.js b/src/member-api.js index 570048bc4..8a4f7df3a 100644 --- a/src/member-api.js +++ b/src/member-api.js @@ -25,7 +25,7 @@ export class MemberApi extends TypedEmitter { * @param {string} deviceId * * @param {Object} opts - * @param {string} opts.role + * @param {string} opts.roleId * @param {number} [opts.timeout] * * @returns {Promise} @@ -33,11 +33,15 @@ export class MemberApi extends TypedEmitter { async invite(deviceId, { timeout }) { const projectInfo = await this.#getProjectInfo() - return this.#rpc.invite(deviceId, { + const response = await this.#rpc.invite(deviceId, { projectKey: this.#projectKey, encryptionKeys: this.#encryptionKeys, projectInfo, timeout, }) + + // TODO: If response is ACCEPT, write to capabilities + + return response } } diff --git a/tests/member-api.js b/tests/member-api.js index e89c49209..096275505 100644 --- a/tests/member-api.js +++ b/tests/member-api.js @@ -26,7 +26,7 @@ test('Invite sends expected project-related details', async (t) => { r1.on('peers', async (peers) => { const response = await memberApi.invite(peers[0].id, { - role: 'member', + roleId: randomBytes(8).toString('hex'), }) t.is(response, InviteResponse_Decision.ACCEPT)