Skip to content

Commit

Permalink
Merge pull request #2468 from reduxjs/revert-2465-feature/utils
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jun 29, 2022
2 parents d63dad9 + 3da5d74 commit 720f143
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions packages/toolkit/src/query/tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ describe('joinUrls', () => {

expect(joinUrls('', '/banana')).toBe('/banana')
expect(joinUrls('', 'banana')).toBe('banana')

expect(joinUrls('/api', '?foo=bar')).toBe('/api?foo=bar')
})

test('correctly joins variations of absolute urls', () => {
Expand All @@ -101,10 +99,6 @@ describe('joinUrls', () => {
expect(joinUrls('https://example.com/api/', '/banana/')).toBe(
'https://example.com/api/banana/'
)

expect(joinUrls('https://example.com/api/', '?foo=bar')).toBe(
'https://example.com/api?foo=bar'
)
})
})

Expand Down
3 changes: 1 addition & 2 deletions packages/toolkit/src/query/utils/joinUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function joinUrls(

base = withoutTrailingSlash(base)
url = withoutLeadingSlash(url)
const delimiter = url.startsWith('?') ? '' : '/'

return `${base}${delimiter}${url}`;
return `${base}/${url}`
}

0 comments on commit 720f143

Please sign in to comment.