Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Văn Hoàng
VCCI-News
Commits
ba598fec
Commit
ba598fec
authored
Aug 06, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Plain Diff
[tag]0.1-vcci
parents
a8c42c76
9679ec88
Pipeline
#52409
passed with stages
in 2 minutes and 16 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
custom-client.ts
src/api/mutator/custom-client.ts
+10
-1
No files found.
src/api/mutator/custom-client.ts
View file @
ba598fec
...
...
@@ -168,7 +168,16 @@ const withNoopCancel = <T>(promise: Promise<T>): CustomClientPromise<T> => {
return
nextPromise
;
};
const
useCustomClient
=
<
T
>
(
url
:
string
,
options
?:
RequestInit
):
Promise
<
T
>
=>
{
const
API_PREFIX
=
"/api/v1.0"
;
const
normalizeApiUrl
=
(
url
:
string
):
string
=>
{
if
(
/^https
?
:
\/\/
/i
.
test
(
url
))
return
url
;
if
(
url
.
startsWith
(
`
${
API_PREFIX
}
/`
)
||
url
.
startsWith
(
`
${
API_PREFIX
}
?`
))
return
url
;
return
`
${
API_PREFIX
}${
url
.
startsWith
(
"/"
)
?
""
:
"/"
}${
url
}
`
;
};
const
useCustomClient
=
<
T
>
(
rawUrl
:
string
,
options
?:
RequestInit
):
Promise
<
T
>
=>
{
const
url
=
normalizeApiUrl
(
rawUrl
);
const
method
=
getRequestMethod
(
options
);
const
shouldCacheGet
=
shouldUseGetCache
(
url
,
options
);
const
cacheKey
=
shouldCacheGet
?
makeGetCacheKey
(
url
,
options
)
:
""
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment