fix: html/apiUrls cannot end with /

This commit is contained in:
Andras Bacsai 2022-04-08 10:57:44 +02:00
parent 1657e5a151
commit 0b709c93a8
2 changed files with 8 additions and 8 deletions

View File

@ -12,8 +12,8 @@
try {
await post(`/sources/${id}.json`, {
name: source.name,
htmlUrl: source.htmlUrl,
apiUrl: source.apiUrl
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, '')
});
toast.push('Settings saved.');
} catch ({ error }) {
@ -50,8 +50,8 @@
await post(`/sources/${id}/github.json`, {
type: 'github',
name: source.name,
htmlUrl: source.htmlUrl,
apiUrl: source.apiUrl
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, '')
});
} catch ({ error }) {
return errorNotification(error);

View File

@ -38,8 +38,8 @@
await post(`/sources/${id}/gitlab.json`, {
type: 'gitlab',
name: source.name,
htmlUrl: source.htmlUrl,
apiUrl: source.apiUrl,
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, ''),
oauthId: source.gitlabApp.oauthId,
appId: source.gitlabApp.appId,
appSecret: source.gitlabApp.appSecret,
@ -56,8 +56,8 @@
try {
await post(`/sources/${id}.json`, {
name: source.name,
htmlUrl: source.htmlUrl,
apiUrl: source.apiUrl
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, '')
});
} catch ({ error }) {
return errorNotification(error);