From 25051df626838e3f17e7fc98cb43cfaf57ac753d Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 27 Mar 2024 13:08:52 +0200 Subject: [PATCH] [plugins-functionality | DONE | CHANGED] update plugin service methods signatures to contain pid, to be able to apply authorization --- services/plugins.service.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/services/plugins.service.ts b/services/plugins.service.ts index 3e7dafee..b9e45511 100644 --- a/services/plugins.service.ts +++ b/services/plugins.service.ts @@ -23,12 +23,12 @@ export class PluginsService { return this.http.post(api + 'pluginTemplate/save/order/' + position, pluginTemplate, CustomOptions.getAuthOptionsWithBody()); } - updatePluginOrder(plugin: Plugin, api: string, position) { - return this.http.post(api + 'plugin/save/order/' + position, plugin, CustomOptions.getAuthOptionsWithBody()); + updatePluginOrder(plugin: Plugin, api: string, position, community) { + return this.http.post(api + 'community/'+community+'/plugin/save/order/' + position, plugin, CustomOptions.getAuthOptionsWithBody()); } - savePlugin(plugin, api: string) { - return this.http.post(api + 'plugin/save', JSON.stringify(plugin), CustomOptions.getAuthOptionsWithBody()); + savePlugin(plugin, api: string, community) { + return this.http.post(api + 'community/' + community + '/plugin/save', JSON.stringify(plugin), CustomOptions.getAuthOptionsWithBody()); } deletePluginTemplate(id, api: string) { @@ -58,4 +58,8 @@ export class PluginsService { let url = api + 'community/' + pid + '/pluginTemplates/page/route?route=' + route; return this.http.get>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload?'&forceReload=true':'')) : url); } + + togglePlugin(id: string, status: boolean, api: string, community) { + return this.http.post(api + 'community/' + community + '/plugin/status/' + id, status, CustomOptions.getAuthOptionsWithBody()); + } }