mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 19:32:49 +00:00
Merge branch 'update_for_search_option_api' into 'master'
Fix api calls for new search option api See merge request openlp/web-remote!32
This commit is contained in:
commit
e6366ce12e
@ -28,14 +28,19 @@ export class SearchOptionsComponent {
|
|||||||
getSearchOptions() {
|
getSearchOptions() {
|
||||||
this.openlpService.getSearchOptions(this.selectedPlugin).subscribe(res => {
|
this.openlpService.getSearchOptions(this.selectedPlugin).subscribe(res => {
|
||||||
if (this.selectedPlugin === 'bibles') {
|
if (this.selectedPlugin === 'bibles') {
|
||||||
this.searchOptions = res['bibles'];
|
for (const option of res) {
|
||||||
this.selectedSearchOption = res['primary'];
|
if (option.name === 'primary bible') {
|
||||||
|
this.searchOptions = option['list'];
|
||||||
|
this.selectedSearchOption = option['selected'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setSearchOption(option) {
|
setSearchOption(target) {
|
||||||
this.openlpService.setSearchOption(this.selectedPlugin, option.value).subscribe(res => {});
|
this.openlpService.setSearchOption(this.selectedPlugin, 'primary bible', target.value).subscribe(res => {});
|
||||||
this.selectedSearchOption = option.value;
|
this.selectedSearchOption = target.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ export class OpenLPService {
|
|||||||
return this.http.get(`${this.apiURL}/plugins/${plugin}/search-options`, httpOptions);
|
return this.http.get(`${this.apiURL}/plugins/${plugin}/search-options`, httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
setSearchOption(plugin, option): Observable<any> {
|
setSearchOption(plugin, option, value): Observable<any> {
|
||||||
return this.http.post(`${this.apiURL}/plugins/${plugin}/search-options`, {'option': option}, httpOptions);
|
return this.http.post(`${this.apiURL}/plugins/${plugin}/search-options`, {'option': option, 'value': value}, httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
getServiceItems(): Observable<ServiceItem[]> {
|
getServiceItems(): Observable<ServiceItem[]> {
|
||||||
|
Loading…
Reference in New Issue
Block a user