From 711258d7c9308b51956f1193283d9bb31d644908 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 22 Jan 2024 08:11:44 +0100 Subject: [PATCH] fix(mention): use new url schema Signed-off-by: Max --- cypress/e2e/nodes/Mentions.spec.js | 3 +++ src/components/Suggestion/Mention/suggestions.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/nodes/Mentions.spec.js b/cypress/e2e/nodes/Mentions.spec.js index f62d4a6866b..6737535c92a 100644 --- a/cypress/e2e/nodes/Mentions.spec.js +++ b/cypress/e2e/nodes/Mentions.spec.js @@ -72,8 +72,11 @@ describe('Test mentioning users', () => { return cy.wait(`@${autocompleteReauestAlias}`) .then(() => { + cy.intercept({ method: 'PUT', url: '**/mention' }).as('putMention') cy.get('.tippy-box .suggestion-list').contains(mention).click() cy.get('span.mention').contains(mention).should('be.visible') + cy.wait('@putMention') + .its('response.statusCode').should('eq', 200) }) }) diff --git a/src/components/Suggestion/Mention/suggestions.js b/src/components/Suggestion/Mention/suggestions.js index 8934d87f68d..a48a5ccd8d3 100644 --- a/src/components/Suggestion/Mention/suggestions.js +++ b/src/components/Suggestion/Mention/suggestions.js @@ -6,8 +6,9 @@ import createSuggestions from '../suggestions.js' const USERS_LIST_ENDPOINT_URL = generateUrl('apps/text/api/v1/users') const emitMention = ({ session, props }) => { - axios.put(generateUrl('apps/text/session/mention'), { - documentId: session.documentId, + const documentId = session.documentId + axios.put(generateUrl(`apps/text/session/${documentId}/mention`), { + documentId, sessionId: session.id, sessionToken: session.token, mention: props.id,