Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
094b0ec6
authored
2024-11-22 09:52:08 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Don't add '/' when building the full url from base and page.
1 parent
ddb16a0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
lib/remote-content.ts
lib/remote-content.ts
View file @
094b0ec
...
...
@@ -31,8 +31,8 @@ const baseQuery = fetchBaseQuery()
const
siteBaseQuery
=
async
(
args
,
api
,
options
)
=>
{
const
{
site
,
url
}
=
args
const
baseUrl
=
getSiteBaseUrl
(
site
)
return
baseQuery
({
...
args
,
url
:
`
${
baseUrl
?
`
${
baseUrl
}
/`
:
''
}${
url
}
`
},
api
,
options
)
const
baseUrl
=
getSiteBaseUrl
(
site
)
||
''
return
baseQuery
({
...
args
,
url
:
`
${
baseUrl
}${
url
}
`
},
api
,
options
)
}
export
const
sitePageSlice
=
createApi
({
...
...
@@ -80,7 +80,7 @@ export const getUrl = async(url: string) => {
for
(
const
site
of
sites
)
{
const
baseUrl
=
configSlice
.
selectors
.
getSiteBaseUrl
(
state
,
site
)
if
(
url
.
startsWith
(
baseUrl
))
{
return
getSitePage
(
site
,
url
.
substring
(
baseUrl
.
length
+
1
))
return
getSitePage
(
site
,
url
.
substring
(
baseUrl
.
length
))
}
}
return
getSitePage
(
'default'
,
url
)
...
...
Please
register
or
sign in
to post a comment