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

View File

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