address form family details form and banking details

This commit is contained in:
Akisha 2018-11-07 18:53:23 +05:30
parent c826296f63
commit 507cc1c2fd
5 changed files with 1944 additions and 1083 deletions

View File

@ -121,3 +121,34 @@ mat-icon{
right: 69px; right: 69px;
top: 112px; top: 112px;
} }
.address {
display: flex;
padding: 0 2%;
flex-direction: column;
}
.address > * {
width: 100%;
}
.matcard mat-form-field {
margin: 0 2%;
}
.address .button {
float: right;
width: 10px;
background: #62B013;
color: white;
}
.banlFields mat-form-field {
width: 100%;
margin: 0 2%;
}
.bankForm .button {
float: right;
width: 10px;
background: #62B013;
color: white;
}
.has-danger{
border: solid thin #f44336!important;
}

View File

@ -1,123 +1,130 @@
import { NgModule } from '@angular/core'; import {NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import {CommonModule} from '@angular/common';
import { import {
MatCardModule,
MatIconModule,
MatInputModule,
MatRadioModule,
MatButtonModule,MatTableModule,MatPaginatorModule,
MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule, MatStepperModule ,MatSidenavModule ,MatMenuModule, MatButtonToggleModule } from '@angular/material';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
import { TreeModule } from 'angular-tree-component';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MatTooltipModule } from '@angular/material/tooltip';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import 'hammerjs';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
import { AgmCoreModule } from '@agm/core';
import { ManagePdRoutingModule } from './manage-pd.routing';
import { ListPdComponent } from './list-pd/list-pd.component';
import { ManagePdComponent } from './manage-pd.component';
import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component';
import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component';
import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component';
import { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-allocation.component';
import { SmartPdAllocationComponent } from './list-pd/smart-pd-allocation/smart-pd-allocation.component';
import { PdTrigerService } from '../pd-service/pd-triger.service';
import { GetGeometricLocationService } from '../location-service/get-geometric-location.service';
import { SchedulePdComponent } from './list-pd/schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from './list-pd/edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from './list-pd/edit-pd-master/edit-pd-master.component';
import { StartPdComponent } from './list-pd/start-pd/start-pd.component';
import { InprogressPdComponent } from './list-pd/inprogress-pd/inprogress-pd.component';
import { AllPdComponent } from './list-pd/all-pd/all-pd.component';
import { ScheduledPdComponent } from './list-pd/scheduled-pd/scheduled-pd.component';
import { CompletedPdComponent } from './list-pd/completed-pd/completed-pd.component';
import { QcCompletedPdComponent } from './list-pd/qc-completed-pd/qc-completed-pd.component';
import { ClientInfoComponent } from './list-pd/start-pd/forms/client-info/client-info.component';
import { SupplierInfoComponent } from './list-pd/start-pd/forms/supplier-info/supplier-info.component';
import { PersonalInfoComponent } from './list-pd/start-pd/forms/personal-info/personal-info.component';
/**
* Custom angular notifier options
*/
const pdCustomNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 5000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
imports: [
CommonModule,
ManagePdRoutingModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
MatCardModule, MatCardModule,
MatIconModule, MatIconModule,
MatInputModule, MatInputModule,
MatRadioModule, MatRadioModule,
MatTableModule, MatButtonModule, MatTableModule, MatPaginatorModule,
MatPaginatorModule, MatProgressBarModule, MatDialogModule, MatSortModule,
MatButtonModule, MatToolbarModule, MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule,
MatProgressBarModule, MatBadgeModule, MatExpansionModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
MatToolbarModule, MatAutocompleteModule
FlexLayoutModule, } from '@angular/material';
NgxDatatableModule, import {MatSlideToggleModule} from '@angular/material/slide-toggle';
FormsModule,MatSlideToggleModule, import {FormsModule, ReactiveFormsModule} from '@angular/forms';
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule, import {FileUploadModule} from 'ng2-file-upload/ng2-file-upload';
ReactiveFormsModule, import {TreeModule} from 'angular-tree-component';
FileUploadModule, import {NgxDatatableModule} from '@swimlane/ngx-datatable';
TreeModule, import {FlexLayoutModule} from '@angular/flex-layout';
MatDialogModule,MatSortModule, import {MatTooltipModule} from '@angular/material/tooltip';
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule, import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
OwlNativeDateTimeModule, import 'hammerjs';
], import {NotifierModule, NotifierOptions} from 'angular-notifier';
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent], import {OwlDateTimeModule, OwlNativeDateTimeModule} from 'ng-pick-datetime';
exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
providers: [PdTrigerService, GetGeometricLocationService], import {AgmCoreModule} from '@agm/core';
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent] import {ManagePdRoutingModule} from './manage-pd.routing';
import {ListPdComponent} from './list-pd/list-pd.component';
import {ManagePdComponent} from './manage-pd.component';
import {MapPdViewComponent} from './list-pd/map-pd-view/map-pd-view.component';
import {AddPdComponent} from '../manage-pd/list-pd/add-pd/add-pd.component';
import {ViewPdComponent} from '../manage-pd/list-pd/view-pd/view-pd.component';
import {PdAllocationComponent} from '../manage-pd/list-pd/pd-allocation/pd-allocation.component';
import {SmartPdAllocationComponent} from './list-pd/smart-pd-allocation/smart-pd-allocation.component';
import {PdTrigerService} from '../pd-service/pd-triger.service';
import {GetGeometricLocationService} from '../location-service/get-geometric-location.service';
import {SchedulePdComponent} from './list-pd/schedule-pd/schedule-pd.component';
import {EditPdApplicantComponent} from './list-pd/edit-pd-applicant/edit-pd-applicant.component';
import {EditPdMasterComponent} from './list-pd/edit-pd-master/edit-pd-master.component';
import {StartPdComponent} from './list-pd/start-pd/start-pd.component';
import {InprogressPdComponent} from './list-pd/inprogress-pd/inprogress-pd.component';
import {AllPdComponent} from './list-pd/all-pd/all-pd.component';
import {ScheduledPdComponent} from './list-pd/scheduled-pd/scheduled-pd.component';
import {CompletedPdComponent} from './list-pd/completed-pd/completed-pd.component';
import {QcCompletedPdComponent} from './list-pd/qc-completed-pd/qc-completed-pd.component';
import {ClientInfoComponent} from './list-pd/start-pd/forms/client-info/client-info.component';
import {SupplierInfoComponent} from './list-pd/start-pd/forms/supplier-info/supplier-info.component';
import {PersonalInfoComponent} from './list-pd/start-pd/forms/personal-info/personal-info.component';
/**
* Custom angular notifier options
*/
const pdCustomNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 5000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
imports: [
CommonModule,
ManagePdRoutingModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
MatCardModule,
MatIconModule,
MatInputModule,
MatRadioModule,
MatTableModule,
MatPaginatorModule,
MatButtonModule,
MatProgressBarModule,
MatAutocompleteModule,
MatToolbarModule,
FlexLayoutModule,
NgxDatatableModule,
FormsModule,
MatSlideToggleModule,
MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
ReactiveFormsModule,
FileUploadModule,
TreeModule,
MatDialogModule, MatSortModule,
NgxMatSelectSearchModule, MatTooltipModule, MatExpansionModule,
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
OwlNativeDateTimeModule,
],
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent],
exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
providers: [PdTrigerService, GetGeometricLocationService],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent]
}) })
export class ManagePdModule { } export class ManagePdModule {
}

View File

@ -1,210 +1,241 @@
/** Common Import Section */ /** Common Import Section */
import { Injectable } from '@angular/core'; import {Injectable} from '@angular/core';
import { Observable } from 'rxjs';//for Datatables import {Observable} from 'rxjs';//for Datatables
import { HttpClient,HttpParams } from '@angular/common/http'; import {HttpClient, HttpParams} from '@angular/common/http';
import { catchError, map } from 'rxjs/operators'; import {catchError, map} from 'rxjs/operators';
import { of } from 'rxjs'; import {of} from 'rxjs';
/** Imported Service Files Are., */ /** Imported Service Files Are., */
import { AwsService } from '../../AwsService/aws.service'; import {AwsService} from '../../AwsService/aws.service';
/** Environment */ /** Environment */
import { environment } from 'environments/environment' import {environment} from 'environments/environment'
const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' ');
const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
/** Master Interface */ /** Master Interface */
export interface Master { export interface Master {
master_id:number; master_id: number;
master_name:string; master_name: string;
constant_name:string; constant_name: string;
} }
@Injectable() @Injectable()
export class PdTrigerService { export class PdTrigerService {
//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; // private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
//private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/"; // private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/";
//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; MAP_API_KEY: string;
private apiUrl = environment.apiEndpoint; MAP_API_URL: string;
MAP_API_KEY: string; // private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
MAP_API_URL: string; private apiUrl = environment.apiEndpoint;
constructor(private _http: HttpClient,
private _aws:AwsService) {
this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'
this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
}
// get add pd master details
getAllMasterDatas(TableName:string): Observable<any> {
return this._http.post<any>(this.apiUrl+'getListOfMaster', { "master_name":TableName })
.pipe(
catchError(this.handleError('role', []))
)
}
//get product and subproduct master details
getProductsDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl+'getListOfProducts')
.pipe(
catchError(this.handleError('role', []))
)
}
// get lenders list
getLenderDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl+'getListOfLenders')
.pipe(
catchError(this.handleError('role', []))
)
}
// get customers list
getCustomersDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl+'getListOfCustomerSegments')
.pipe(
catchError(this.handleError('role', []))
)
}
// get Pd Allocation type details list
getPDAllocationDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl+'getListOfPDAllocationTypes')
.pipe(
catchError(this.handleError('role', []))
)
}
// get state and city details
getStateCityDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl+'getListOfStatesAndCities')
.pipe(
catchError(this.handleError('role', []))
)
}
// get pd type and allocation type details
getPDTypeDetails():Observable<any> {
return this._http.get<any>(this.apiUrl+'getListOfPDAllocationTypes')
.pipe(
catchError(this.handleError('role', []))
)
}
// add pd details
addPdDetails(pdForm: any): Observable<any> {
return this._http.post<any>(this.apiUrl+"triggerNewPD", pdForm)
.pipe(
catchError(this.handleError('operation', []))
)
}
// get pd details
getPdDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl+"listLessPDDetails/get")
.pipe(
catchError(this.handleError('operation', []))
)
}
// get status based pd list constructor(private _http: HttpClient,
getTabStatusPdDetails(status:string): Observable<any> { private _aws: AwsService) {
const tabStatus = status ? this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'
{ params: new HttpParams().set('status', status) } : {}; this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
return this._http.get<any[]>(this.apiUrl+"listLessPDDetails/get",tabStatus) }
.pipe(
catchError(this.handleError('operation', []))
)
}
// get edit row pd details // get add pd master details
editPdDetails(editId:string):Observable<any>{ getAllMasterDatas(TableName: string): Observable<any> {
let httpParams = new HttpParams().set('pdid', editId); console.log('table', TableName);
return this._http.post<any>(this.apiUrl+"getFullPDDetails",httpParams) return this._http.post(this.apiUrl + 'getListOfMaster', {"master_name": TableName})
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('role', []))
) )
} }
// update pd master details saveForm(records): Observable<any> {
editPdMasterDetails(editData:any,status:string):Observable<any>{ console.log('table', records);
let params = {records}
return this._http.post(this.apiUrl + 'savePDFormDetails', params)
.pipe(
catchError(this.handleError('role', []))
)
}
retriveForm(params): Observable<any> {
console.log('data', params);
return this._http.post(this.apiUrl + 'getPDFormDetails', params)
.pipe(
catchError(this.handleError('role', []))
)
}
//get product and subproduct master details
getProductsDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + 'getListOfProducts')
.pipe(
catchError(this.handleError('role', []))
)
}
// get lenders list
getLenderDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + 'getListOfLenders')
.pipe(
catchError(this.handleError('role', []))
)
}
// get customers list
getCustomersDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + 'getListOfCustomerSegments')
.pipe(
catchError(this.handleError('role', []))
)
}
// get Pd Allocation type details list
getPDAllocationDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + 'getListOfPDAllocationTypes')
.pipe(
catchError(this.handleError('role', []))
)
}
// get state and city details
getStateCityDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + 'getListOfStatesAndCities')
.pipe(
catchError(this.handleError('role', []))
)
}
// get pd type and allocation type details
getPDTypeDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + 'getListOfPDAllocationTypes')
.pipe(
catchError(this.handleError('role', []))
)
}
// add pd details
addPdDetails(pdForm: any): Observable<any> {
return this._http.post<any>(this.apiUrl + "triggerNewPD", pdForm)
.pipe(
catchError(this.handleError('operation', []))
)
}
// get pd details
getPdDetails(): Observable<any> {
return this._http.get<any>(this.apiUrl + "listLessPDDetails/get")
.pipe(
catchError(this.handleError('operation', []))
)
}
// get status based pd list
getTabStatusPdDetails(status: string): Observable<any> {
const tabStatus = status ?
{params: new HttpParams().set('status', status)} : {};
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", tabStatus)
.pipe(
catchError(this.handleError('operation', []))
)
}
// get edit row pd details
editPdDetails(editId: string): Observable<any> {
let httpParams = new HttpParams().set('pdid', editId);
return this._http.post<any>(this.apiUrl + "getFullPDDetails", httpParams)
.pipe(
catchError(this.handleError('operation', []))
)
}
// update pd master details
editPdMasterDetails(editData: any, status: string): Observable<any> {
editData.pd_status = status; editData.pd_status = status;
editData.fk_updatedby = this._aws.getlocale(); editData.fk_updatedby = this._aws.getlocale();
editData.updatedon = currentdate; editData.updatedon = currentdate;
return this._http.post<any>(this.apiUrl+"updatePDMaster",{records:editData}) return this._http.post<any>(this.apiUrl + "updatePDMaster", {records: editData})
.pipe(
catchError(this.handleError('operation', []))
)
}
// update pd applicant
updatePdApplicant(editData:any):Observable<any>{
// editData.fk_updatedby = this._aws.getlocale();
// editData.updatedon = currentdate;
return this._http.post<any>(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData})
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
// update pd applicant
updatePdApplicant(editData: any): Observable<any> {
// editData.fk_updatedby = this._aws.getlocale();
// editData.updatedon = currentdate;
return this._http.post<any>(this.apiUrl + "updatePDApplicants", {"pd_applicant_details": editData})
.pipe(
catchError(this.handleError('operation', []))
)
}
// get pd allocation to details
getPdOfficerList(pdID: string): Observable<any> {
return this._http.post<any>(this.apiUrl + "getListPDOfficers", {"pdid": pdID})
.pipe(
catchError(this.handleError('operation', []))
)
}
// get pd allocation to details
getPdOfficerList(pdID:string): Observable<any> {
return this._http.post<any>(this.apiUrl+"getListPDOfficers",{"pdid":pdID})
.pipe(
catchError(this.handleError('operation', []))
)
}
// update pd officer // update pd officer
updatePdOfficer(updateData: any): Observable<any> { updatePdOfficer(updateData: any): Observable<any> {
updateData.fk_updatedby = this._aws.getlocale(); updateData.fk_updatedby = this._aws.getlocale();
updateData.updatedon = currentdate; updateData.updatedon = currentdate;
return this._http.post<any>(this.apiUrl+"allocatePD",{"records":updateData}) return this._http.post<any>(this.apiUrl + "allocatePD", {"records": updateData})
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
// update pd schedule // update pd schedule
updateSchedule(updateData: any): Observable<any> { updateSchedule(updateData: any): Observable<any> {
updateData.fk_scheduled_by = this._aws.getlocale(); updateData.fk_scheduled_by = this._aws.getlocale();
updateData.createdon = currentdate; updateData.createdon = currentdate;
return this._http.post<any>(this.apiUrl+"schdulePD",{"records":updateData}) return this._http.post<any>(this.apiUrl + "schdulePD", {"records": updateData})
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
//load pd template details //load pd template details
loadPDTemplates(pdId: string):Observable<any>{ loadPDTemplates(pdId: string): Observable<any> {
const options = pdId ? const options = pdId ?
{ params: new HttpParams().set('pd_id', pdId) } : {}; {params: new HttpParams().set('pd_id', pdId)} : {};
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate",options) return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
// load PD question answers // load PD question answers
getAnswersForPD(list: any):Observable<any>{ getAnswersForPD(list: any): Observable<any> {
let httpParams = new HttpParams(); let httpParams = new HttpParams();
httpParams = httpParams.append("category_id", list.category_id); httpParams = httpParams.append("category_id", list.category_id);
httpParams = httpParams.append("pd_id", list.pd_id); httpParams = httpParams.append("pd_id", list.pd_id);
httpParams = httpParams.append("question_id", list.question_id); httpParams = httpParams.append("question_id", list.question_id);
httpParams = httpParams.append("template_id", list.template_id); httpParams = httpParams.append("template_id", list.template_id);
return this._http.post<any[]>(this.apiUrl + "getAnswersForPD",httpParams) return this._http.post<any[]>(this.apiUrl + "getAnswersForPD", httpParams)
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
// save pd answers // save pd answers
savePDQuestions(saveData: any): Observable<any> { savePDQuestions(saveData: any): Observable<any> {
saveData.createdby = this._aws.getlocale(); saveData.createdby = this._aws.getlocale();
saveData.fk_createdon = currentdate; saveData.fk_createdon = currentdate;
// saveData[0].fk_updatedby = this._aws.getlocale(); // saveData[0].fk_updatedby = this._aws.getlocale();
// saveData[0].updatedon = currentdate; // saveData[0].updatedon = currentdate;
return this._http.post<any>(this.apiUrl+"savePDQuestions",{"records":saveData}) return this._http.post<any>(this.apiUrl + "savePDQuestions", {"records": saveData})
.pipe( .pipe(
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
private handleError<T>(operation = 'operation', result?: T) { private handleError<T>(operation = 'operation', result?: T) {
return (error: any): Observable<T> => { return (error: any): Observable<T> => {
return of(result as T); return of(result as T);
}; };
} }
} }