refactor: client view survey page (#1112)

Fixes: #1111
This commit is contained in:
Karan Takalkar
2020-07-15 17:25:17 +05:30
committed by GitHub
parent 3fbe2815a0
commit 2670137564
12 changed files with 67 additions and 130 deletions
@@ -33,6 +33,8 @@ export class ClientActionsResolver implements Resolve<Object> {
return this.clientsService.getClientDataAndTemplate(clientId);
case 'Survey':
return this.clientsService.getSurveys(clientId);
case 'Take Survey':
return this.clientsService.getAllSurveysType();
case 'Close':
return this.clientsService.getClientCommandTemplate('close');
case 'Reject':
@@ -1,30 +0,0 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Clients Services */
import { ClientsService } from '../clients.service';
/**
* Take Survey data resolver.
*/
@Injectable()
export class TakeSurveyResolver implements Resolve<Object> {
/**
* @param {ClientsService} clientsService Client service.
*/
constructor(private clientsService: ClientsService) { }
/**
* Returns the All Survey Type and question data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.clientsService.getAllSurveysType();
}
}