diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-26 09:35:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-26 15:18:29 +0200 |
commit | ba211e7386bb2f25e37a4c5bcdfeb4237e1cd315 (patch) | |
tree | 398bb14a92c7df3765a0a64bac9f4672c5588488 /client/src/app/core | |
parent | 23bdacf8ec24ce47a15529830e116911d7478598 (diff) | |
download | PeerTube-ba211e7386bb2f25e37a4c5bcdfeb4237e1cd315.tar.gz PeerTube-ba211e7386bb2f25e37a4c5bcdfeb4237e1cd315.tar.zst PeerTube-ba211e7386bb2f25e37a4c5bcdfeb4237e1cd315.zip |
Add public settings endpoint
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/plugins/plugin.service.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 45d8088a4..714abd82d 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts | |||
@@ -15,6 +15,7 @@ import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' | |||
15 | import { HttpClient } from '@angular/common/http' | 15 | import { HttpClient } from '@angular/common/http' |
16 | import { RestExtractor } from '@app/shared/rest' | 16 | import { RestExtractor } from '@app/shared/rest' |
17 | import { PluginType } from '@shared/models/plugins/plugin.type' | 17 | import { PluginType } from '@shared/models/plugins/plugin.type' |
18 | import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' | ||
18 | 19 | ||
19 | interface HookStructValue extends RegisterClientHookOptions { | 20 | interface HookStructValue extends RegisterClientHookOptions { |
20 | plugin: ServerConfigPlugin | 21 | plugin: ServerConfigPlugin |
@@ -241,11 +242,11 @@ export class PluginService implements ClientHook { | |||
241 | 242 | ||
242 | getSettings: () => { | 243 | getSettings: () => { |
243 | const npmName = this.nameToNpmName(pluginInfo.plugin.name, pluginInfo.pluginType) | 244 | const npmName = this.nameToNpmName(pluginInfo.plugin.name, pluginInfo.pluginType) |
244 | const path = PluginService.BASE_PLUGIN_URL + '/' + npmName | 245 | const path = PluginService.BASE_PLUGIN_URL + '/' + npmName + '/public-settings' |
245 | 246 | ||
246 | return this.authHttp.get<PeerTubePlugin>(path) | 247 | return this.authHttp.get<PublicServerSetting>(path) |
247 | .pipe( | 248 | .pipe( |
248 | map(p => p.settings), | 249 | map(p => p.publicSettings), |
249 | catchError(res => this.restExtractor.handleError(res)) | 250 | catchError(res => this.restExtractor.handleError(res)) |
250 | ) | 251 | ) |
251 | .toPromise() | 252 | .toPromise() |