Commit f7778f24 by Your Name

update book lists

parent c77efee4
......@@ -19,10 +19,10 @@ export class MyRoom implements Room{
// Object.assign(this, init);
this.rId = init?.rId!;
this.rName = init?.rName!;
this.rType = 0;
this.rPic = 'assets/img/nopic.jpg';
this.roomLimit = 0;
this.rDesc = '';
this.rType = 0;
}
}
......
......@@ -209,8 +209,12 @@ export class AdminPendingComponent implements OnInit {
myFormEquir: FormGroup;
ngOnInit(): void {
this.listItemDetail = this.ItemDetailService.getListItemDetail();
this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
this.ItemDetailService.getListItemDetail().subscribe( result => {
this.listItemDetail = result;
});
this.RoomDetailService.getListRoomDetail().subscribe( result => {
this.listRoomDetail = result;
});
this.collectionSizeListRoom = this.listItemDetail.length;
}
......
......@@ -29,7 +29,7 @@
<br>
<p class="text-left">ชื่อ : {{item.rName}}</p>
<p class="text-left">รายละเอียด : {{item.rDesc}}</p>
<p class="text-left">หมวดหมู่ : <td *ngIf="item.rStatus==1">ห้อง</td><td *ngIf="item.rStatus==2">รถ</td></p>
<p class="text-left">หมวดหมู่ : <td *ngIf="item.rType==1">ห้อง</td><td *ngIf="item.rType==2">รถ</td></p>
</div>
<div class="text-center">
......
......@@ -204,8 +204,12 @@ export class HomePageComponent implements OnInit {
setTimeout(function () {
window.dispatchEvent(new Event('resize'))
}, 1)
this.listItemDetail = this.ItemDetailService.getListItemDetail();
this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
this.ItemDetailService.getListItemDetail().subscribe( result => {
this.listItemDetail = result;
});
this.RoomDetailService.getListRoomDetail().subscribe( result => {
this.listRoomDetail = result;
});
for (let i = 0; i < this.listRoomDetail.length; i++) {
if (this.listRoomDetail[i].rStatus == 0) {
this.eventRoom.push({
......
......@@ -209,8 +209,12 @@ export class PendingComponent implements OnInit {
}
ngOnInit() {
this.listItemDetail = this.ItemDetailService.getListItemDetail();
this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
this.ItemDetailService.getListItemDetail().subscribe( result => {
this.listItemDetail = result;
});
this.RoomDetailService.getListRoomDetail().subscribe( result => {
this.listRoomDetail = result;
});
this.collectionSizeListRoom = this.listRoomDetail.length;
}
......
......@@ -8,7 +8,7 @@ import { Observable } from 'rxjs';
export class EquirmentService {
constructor(private http: HttpClient) { }
url: string = "http://2475-49-0-64-28.ngrok.io";
url: string = "http://a3be-115-87-232-117.ngrok.io";
listEquirment: Equirment[] = []
addEquirment(model: Equirment) {
......
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ItemDetail, SearchItemDetailModel } from '../models/itemDetail.model';
import { Observable } from 'rxjs';
@Injectable({ providedIn: 'root' })
export class ItemDetailService {
constructor(private http: HttpClient) { }
url: string = "http://2475-49-0-64-28.ngrok.io";
url: string = "http://a3be-115-87-232-117.ngrok.io";
listItemDetail: ItemDetail[] = []
addItemDetail(model: ItemDetail) {
......@@ -17,8 +18,8 @@ export class ItemDetailService {
getListItemDetail() {
return this.listItemDetail;
getListItemDetail(): Observable<ItemDetail[]> {
return this.http.get<ItemDetail[]>(this.url + "/lend/lists");
}
// getListItemDetail() {
......
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { RoomDetail, SearchRoomDetailModel } from '../models/RoomDetail.model';
import { Observable } from 'rxjs';
@Injectable({ providedIn: 'root' })
export class RoomDetailService {
constructor(private http: HttpClient) { }
url: string = "http://2475-49-0-64-28.ngrok.io";
url: string = "http://a3be-115-87-232-117.ngrok.io";
listRoomDetail: RoomDetail[] = []
editRoomDetail(model: RoomDetail) {
......@@ -35,8 +36,8 @@ export class RoomDetailService {
}
getListRoomDetail() {
return this.listRoomDetail;
getListRoomDetail() : Observable<RoomDetail[]> {
return this.http.get<RoomDetail[]>(this.url + "/book/lists");
}
......
......@@ -7,7 +7,7 @@ import { RoomDetail } from '../models/RoomDetail.model';
export class RoomService {
constructor(private http: HttpClient) { }
url: string = 'http://2475-49-0-64-28.ngrok.io';
url: string = "http://a3be-115-87-232-117.ngrok.io";
listRoomModel: Room[] = []
listRoomSearch: Room[] = [];
......
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