fix: Enable and disable surveys

The logic to enable and disable surveys was not implemented, and the
state was not shown correctly. The front-end logic now corresponds to
the back-end logic (org.apache.fineract.spm.service.SpmService).
This commit is contained in:
Ralph Hopman
2024-11-28 13:48:52 +01:00
committed by Adam Saghy
parent 31f1890051
commit 43c8fdbe66
3 changed files with 61 additions and 10 deletions
+18
View File
@@ -240,6 +240,24 @@ export class SystemService {
return this.http.put(`/surveys/${surveyId}`, survey);
}
/**
* Activates a survey.
* @param {number} surveyId Survey ID.
* @returns {Observable<any>}
*/
activateSurvey(surveyId: number): Observable<any> {
return this.http.post(`/surveys/${surveyId}?command=activate`, null);
}
/**
* Deactivates a survey.
* @param {number} surveyId Survey ID.
* @returns {Observable<any>}
*/
deactivateSurvey(surveyId: number): Observable<any> {
return this.http.post(`/surveys/${surveyId}?command=deactivate`, null);
}
/**
* @returns {Observable<any>} Fetches Jobs.