Merge pull request #14967 from overleaf/jpa-fetch-mock-last-url

[web] less verbose access to last fetch-mock URL

GitOrigin-RevId: 7266fdd62eab29b944675c865c6c5f547d207abc
This commit is contained in:
Jakob Ackermann 2023-09-26 11:09:19 +02:00 committed by Copybot
parent 8111ff2865
commit 6d31ff6400

View file

@ -618,7 +618,7 @@ function createMessages(number, user, timestamp = Date.now()) {
* Get query param by key from the last fetchMock response * Get query param by key from the last fetchMock response
*/ */
function getLastFetchMockQueryParam(key) { function getLastFetchMockQueryParam(key) {
const { url } = fetchMock.lastResponse() const url = fetchMock.lastUrl()
const { searchParams } = new URL(url, 'https://www.overleaf.com') const { searchParams } = new URL(url, 'https://www.overleaf.com')
return searchParams.get(key) return searchParams.get(key)
} }