Skip to content

Commit

Permalink
rename role to roleId
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Aug 31, 2023
1 parent d2e387c commit 562f73d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/member-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@ 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<import('./generated/rpc.js').InviteResponse_Decision>}
*/
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
}
}
2 changes: 1 addition & 1 deletion tests/member-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 562f73d

Please sign in to comment.