Commit ab11b77f by Nakarin Luankla

UPDATE สร้างแบบฟอร์ม

parent c4ec200a
...@@ -248,6 +248,22 @@ export class EvaluationCycleComponent { ...@@ -248,6 +248,22 @@ export class EvaluationCycleComponent {
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}) })
this.evaluationCycleService.postCreateForm(body).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getEvaluationCycleList()
} else {
this.dataLoading = false
this.showAlert(response.message, 'error')
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
}
})
} }
} }
......
...@@ -25,6 +25,9 @@ export class EvaluationCycleService { ...@@ -25,6 +25,9 @@ export class EvaluationCycleService {
post(body: EvaluationCycleModel): Observable<AlertModel> { post(body: EvaluationCycleModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body) return this.http.post<AlertModel>(this.urlApi, body)
} }
postCreateForm(body: EvaluationCycleModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi+'/create-form', body)
}
delete(body: EvaluationCycleModel | EvaluationCycleModel[]): Observable<AlertModel> { delete(body: EvaluationCycleModel | EvaluationCycleModel[]): Observable<AlertModel> {
const options = { const options = {
headers: new HttpHeaders({ headers: new HttpHeaders({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment