diff --git a/cypress/e2e/memberships/createItemMembership.cy.ts b/cypress/e2e/memberships/createItemMembership.cy.ts index 7ea8beb72..dd0e35096 100644 --- a/cypress/e2e/memberships/createItemMembership.cy.ts +++ b/cypress/e2e/memberships/createItemMembership.cy.ts @@ -52,16 +52,16 @@ describe('Create Membership', () => { const permission = PermissionLevel.Read; shareItem({ id, member, permission }); - cy.wait('@postManyItemMemberships').then( + cy.wait('@postInvitations').then( ({ request: { url, - body: { memberships }, + body: { invitations }, }, }) => { expect(url).to.contain(id); - expect(memberships[0].permission).to.equal(permission); - expect(memberships[0].memberId).to.equal(member.id); + expect(invitations[0].permission).to.equal(permission); + expect(invitations[0].email).to.equal(member.email); }, ); diff --git a/package.json b/package.json index dc4ade491..e58e5cf3c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@emotion/styled": "11.13.0", "@graasp/chatbox": "3.1.0", "@graasp/map": "1.17.0", - "@graasp/query-client": "3.20.3", + "@graasp/query-client": "3.21.0", "@graasp/sdk": "4.22.0", "@graasp/translations": "1.33.0", "@graasp/ui": "4.23.0", diff --git a/src/components/item/sharing/CreateItemMembershipForm.tsx b/src/components/item/sharing/CreateItemMembershipForm.tsx index 940e5a516..0e6fe2314 100644 --- a/src/components/item/sharing/CreateItemMembershipForm.tsx +++ b/src/components/item/sharing/CreateItemMembershipForm.tsx @@ -101,27 +101,21 @@ const CreateItemMembershipForm = ({ let returnedValue; try { - const result = await shareItem({ + await shareItem({ itemId, - data: [ + invitations: [ { - id: itemId, email: invitation.email, permission: invitation.permission, }, ], }); - // manually notify error - if (result?.errors?.length) { - console.error(result?.errors); - } else { - // reset email input - setInvitation({ - ...invitation, - email: '', - }); - } + // reset email input + setInvitation({ + ...invitation, + email: '', + }); } catch (e) { console.error(e); } diff --git a/yarn.lock b/yarn.lock index c5503b393..2a68af602 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1857,9 +1857,9 @@ __metadata: languageName: node linkType: hard -"@graasp/query-client@npm:3.20.3": - version: 3.20.3 - resolution: "@graasp/query-client@npm:3.20.3" +"@graasp/query-client@npm:3.21.0": + version: 3.21.0 + resolution: "@graasp/query-client@npm:3.21.0" dependencies: "@tanstack/react-query": "npm:4.36.1" "@tanstack/react-query-devtools": "npm:4.36.1" @@ -1869,7 +1869,7 @@ __metadata: "@graasp/sdk": ^4.0.0 "@graasp/translations": "*" react: ^18.0.0 - checksum: 10/29b741787df01cfd537b78985a56c0b9d5a8660943902ee6f4f051a3dcef62028a577068accf590d9ef9010c6892707ee602fb0c666dbe91f81cde01a6c12fe7 + checksum: 10/801a1e1b45f985f82468b2527adc2cda8b2541aac3549a22fde81dc40387867e9f7c46dee001f77d23f4b6a4de19c0d2ea85b0a2f1499e848c880ece69a34177 languageName: node linkType: hard @@ -8145,7 +8145,7 @@ __metadata: "@emotion/styled": "npm:11.13.0" "@graasp/chatbox": "npm:3.1.0" "@graasp/map": "npm:1.17.0" - "@graasp/query-client": "npm:3.20.3" + "@graasp/query-client": "npm:3.21.0" "@graasp/sdk": "npm:4.22.0" "@graasp/translations": "npm:1.33.0" "@graasp/ui": "npm:4.23.0"