[plugins-functionality | DONE | CHANGED] update plugin service methods signatures to contain pid, to be able to apply authorization

This commit is contained in:
argirok 2024-03-27 13:08:52 +02:00
parent 8eba807906
commit 25051df626
1 changed files with 8 additions and 4 deletions

View File

@ -23,12 +23,12 @@ export class PluginsService {
return this.http.post<PluginTemplate>(api + 'pluginTemplate/save/order/' + position, pluginTemplate, CustomOptions.getAuthOptionsWithBody());
}
updatePluginOrder(plugin: Plugin, api: string, position) {
return this.http.post<Plugin>(api + 'plugin/save/order/' + position, plugin, CustomOptions.getAuthOptionsWithBody());
updatePluginOrder(plugin: Plugin, api: string, position, community) {
return this.http.post<Plugin>(api + 'community/'+community+'/plugin/save/order/' + position, plugin, CustomOptions.getAuthOptionsWithBody());
}
savePlugin(plugin, api: string) {
return this.http.post<Plugin>(api + 'plugin/save', JSON.stringify(plugin), CustomOptions.getAuthOptionsWithBody());
savePlugin(plugin, api: string, community) {
return this.http.post<Plugin>(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<Array<PluginTemplate>>((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());
}
}