Skip to content

Commit

Permalink
Gửi dữ liệu lên server
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyengiangk62uet committed Apr 5, 2019
1 parent e205c60 commit f737cf7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Management/src/app/shared/services/exams.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,44 @@ export class ExamsService {
return of(result as T);
};
}

changeStatus(id: string, objUpdate: any): Observable<IExam> {
return this._httpService.put(`${this.apiUrl}/change-status/${id}`, objUpdate)
.pipe(
tap(_ => { }),
catchError(this.handleError<any>('changeStatus'))
);
}

changeStatusMulti(objUpdate: any[]): Observable<IExam[]> {
return this._httpService.put(`${this.apiUrl}/change-status`, objUpdate)
.pipe(
tap(_ => { }),
catchError(this.handleError<any>('changeStatusMulti'))
);
}

changeSpecial(id: string, objUpdate: any): Observable<IExam> {
return this._httpService.put(`${this.apiUrl}/change-special/${id}`, objUpdate)
.pipe(
tap(_ => { }),
catchError(this.handleError<any>('changeSpecial'))
);
}

changeSpecialMulti(objUpdate: any[]): Observable<IExam[]> {
return this._httpService.put(`${this.apiUrl}/change-special`, objUpdate)
.pipe(
tap(_ => { }),
catchError(this.handleError<any>('changeSpecialMulti'))
);
}

changeMultiOnClick(objUpdate: any, prop): Observable<any> {
if (prop === 'status') {
return this.changeStatusMulti(objUpdate);
} else if (prop === 'special') {
return this.changeSpecialMulti(objUpdate);
}
}
}

0 comments on commit f737cf7

Please sign in to comment.