Commit d19b6e76 by kantavee

เเก้ไขชื่อฟังก์ชั่น

parent b846758e
...@@ -24,8 +24,7 @@ export class DepartmentListComponent implements OnInit { ...@@ -24,8 +24,7 @@ export class DepartmentListComponent implements OnInit {
this.getBu2List() this.getBu2List()
} }
getBu2List() { getBu2List() {
this.bu2Service.getBu2().subscribe(response => { this.bu2Service.getList().subscribe(response => {
console.log("31313 : ", response)
this.bu2List = response this.bu2List = response
this.searchChange() this.searchChange()
}) })
...@@ -40,9 +39,8 @@ export class DepartmentListComponent implements OnInit { ...@@ -40,9 +39,8 @@ export class DepartmentListComponent implements OnInit {
x.edesc.toLowerCase().includes(this.search)) x.edesc.toLowerCase().includes(this.search))
} }
selectBu2(bu2: Bu2Model) { selectBu2(bu2: Bu2Model) {
this.bu1Service.getBu1ById(bu2.parent).subscribe(response => { this.bu1Service.getById(bu2.parent).subscribe(response => {
this.bu1 = response this.bu1 = response
console.log(this.bu1)
}) })
this.bu2 = new MyBu2Model(bu2) this.bu2 = new MyBu2Model(bu2)
} }
......
...@@ -18,7 +18,7 @@ export class DepartmentRegisterComponent implements OnInit { ...@@ -18,7 +18,7 @@ export class DepartmentRegisterComponent implements OnInit {
this.getBu1List() this.getBu1List()
} }
getBu1List() { getBu1List() {
this.bu1Service.getBu1().subscribe(response => { this.bu1Service.getList().subscribe(response => {
this.bu1List = response this.bu1List = response
this.searchChange() this.searchChange()
}) })
......
...@@ -11,10 +11,10 @@ export class Bu1Service { ...@@ -11,10 +11,10 @@ export class Bu1Service {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getBu1(): Observable<Bu1Model[]> { getList(): Observable<Bu1Model[]> {
return this.http.get<Bu1Model[]>(this.urlApi + "/lists") return this.http.get<Bu1Model[]>(this.urlApi + "/lists")
} }
getBu1ById(bu1id:string): Observable<Bu1Model> { getById(bu1id:string): Observable<Bu1Model> {
return this.http.get<Bu1Model>(this.urlApi + "/"+bu1id) return this.http.get<Bu1Model>(this.urlApi + "/"+bu1id)
} }
// post(body: Bu1Model) { // post(body: Bu1Model) {
......
...@@ -11,10 +11,10 @@ export class Bu2Service { ...@@ -11,10 +11,10 @@ export class Bu2Service {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getBu2(): Observable<Bu2Model[]> { getList(): Observable<Bu2Model[]> {
return this.http.get<Bu2Model[]>(this.urlApi + "/lists") return this.http.get<Bu2Model[]>(this.urlApi + "/lists")
} }
getBu2ById(bu2id: string): Observable<Bu2Model> { getById(bu2id: string): Observable<Bu2Model> {
return this.http.get<Bu2Model>(this.urlApi + "/" + bu2id) return this.http.get<Bu2Model>(this.urlApi + "/" + bu2id)
} }
// post(body: Bu1Model) { // post(body: Bu1Model) {
......
...@@ -11,10 +11,10 @@ export class Bu4Service { ...@@ -11,10 +11,10 @@ export class Bu4Service {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getBu4(): Observable<Bu4Model[]> { getList(): Observable<Bu4Model[]> {
return this.http.get<Bu4Model[]>(this.urlApi + "/lists") return this.http.get<Bu4Model[]>(this.urlApi + "/lists")
} }
getBu4ById(bu4id: string): Observable<Bu4Model> { getById(bu4id: string): Observable<Bu4Model> {
return this.http.get<Bu4Model>(this.urlApi + "/" + bu4id) return this.http.get<Bu4Model>(this.urlApi + "/" + bu4id)
} }
// post(body: Bu1Model) { // post(body: Bu1Model) {
......
...@@ -11,10 +11,10 @@ export class Bu5Service { ...@@ -11,10 +11,10 @@ export class Bu5Service {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getBu5(): Observable<Bu5Model[]> { getList(): Observable<Bu5Model[]> {
return this.http.get<Bu5Model[]>(this.urlApi + "/lists") return this.http.get<Bu5Model[]>(this.urlApi + "/lists")
} }
getBu5ById(bu5id: string): Observable<Bu5Model> { getById(bu5id: string): Observable<Bu5Model> {
return this.http.get<Bu5Model>(this.urlApi + "/" + bu5id) return this.http.get<Bu5Model>(this.urlApi + "/" + bu5id)
} }
// post(body: Bu1Model) { // post(body: Bu1Model) {
......
...@@ -11,10 +11,10 @@ export class Bu6Service { ...@@ -11,10 +11,10 @@ export class Bu6Service {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getBu6(): Observable<Bu6Model[]> { getList(): Observable<Bu6Model[]> {
return this.http.get<Bu6Model[]>(this.urlApi + "/lists") return this.http.get<Bu6Model[]>(this.urlApi + "/lists")
} }
getBu6ById(bu6id: string): Observable<Bu6Model> { getById(bu6id: string): Observable<Bu6Model> {
return this.http.get<Bu6Model>(this.urlApi + "/" + bu6id) return this.http.get<Bu6Model>(this.urlApi + "/" + bu6id)
} }
// post(body: Bu1Model) { // post(body: Bu1Model) {
......
...@@ -11,10 +11,10 @@ export class Bu7Service { ...@@ -11,10 +11,10 @@ export class Bu7Service {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getBu7(): Observable<Bu7Model[]> { getList(): Observable<Bu7Model[]> {
return this.http.get<Bu7Model[]>(this.urlApi + "/lists") return this.http.get<Bu7Model[]>(this.urlApi + "/lists")
} }
getBu7ById(bu7id: string): Observable<Bu7Model> { getById(bu7id: string): Observable<Bu7Model> {
return this.http.get<Bu7Model>(this.urlApi + "/" + bu7id) return this.http.get<Bu7Model>(this.urlApi + "/" + bu7id)
} }
// post(body: Bu1Model) { // post(body: Bu1Model) {
......
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