BETTERZON-151: Adding option to delete price alarm (#94)

This commit is contained in:
Patrick
2021-06-17 17:15:06 +02:00
committed by GitHub
parent 841502f9d1
commit 45acbfd9a2
4 changed files with 68 additions and 2 deletions
+19
View File
@@ -445,6 +445,25 @@ export class ApiService {
}
}
/**
* Deletes the given price alarm
* @param alarmId the price alarm to delete
* @return Observable<any> The observable response of the api
*/
deletePriceAlarm(alarmId: number): Observable<any> {
try {
const sessionInfo = this.getSessionInfoFromLocalStorage();
let params = new HttpParams();
params = params.append('session_id', sessionInfo.session_id);
params = params.append('session_key', sessionInfo.session_key);
return this.http.delete((this.apiUrl + '/pricealarms/' + alarmId), {params});
} catch (exception) {
process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`);
}
}
/* __ __
/ / / /_______ __________