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);