Commit d0f3a000 by Your Name

update url

parent 5173de1e
...@@ -64,7 +64,6 @@ export class AdminEquirmentComponent implements OnInit { ...@@ -64,7 +64,6 @@ export class AdminEquirmentComponent implements OnInit {
this.listRoomModel = this.roomService.getListRoom(); this.listRoomModel = this.roomService.getListRoom();
this.collectionSizeListRoom = this.listRoomModel.length this.collectionSizeListRoom = this.listRoomModel.length
this.collectionSize = this.listEquirmentModel.length this.collectionSize = this.listEquirmentModel.length
console.log("listRoom", this.listRoomModel)
this.myFormRoom = new FormGroup({ this.myFormRoom = new FormGroup({
userNameForm : new FormControl('',[Validators.required]), userNameForm : new FormControl('',[Validators.required]),
rTelephone : new FormControl('',[Validators.required]), rTelephone : new FormControl('',[Validators.required]),
......
...@@ -7,7 +7,7 @@ import { ItemDetail } from '../models/itemDetail.model'; ...@@ -7,7 +7,7 @@ import { ItemDetail } from '../models/itemDetail.model';
export class EquirmentService { export class EquirmentService {
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
url: string; url: string = " http://abe9-115-87-232-117.ngrok.io";
listEquirment: Equirment[] = [ listEquirment: Equirment[] = [
{ {
eqId: 1, eqId: 1,
...@@ -152,7 +152,18 @@ export class EquirmentService { ...@@ -152,7 +152,18 @@ export class EquirmentService {
] ]
addEquirment(model: Equirment) { addEquirment(model: Equirment) {
this.listEquirment.push(model); // this.listEquirment.push(model);
console.log("model", model)
this.http.post(this.url + "/eqment/", {
"eqId": 1,
"eqName": "หูฟัง",
"eqDesc": "...",
"eqType": "it",
"eqPic": "assets/img/mou.jpg"
}).subscribe(response => {
console.log(response);
})
} }
// bookEquirment(models: ItemDetail){ // bookEquirment(models: ItemDetail){
...@@ -206,7 +217,7 @@ export class EquirmentService { ...@@ -206,7 +217,7 @@ export class EquirmentService {
}) })
} }
updateEquirProfile(model : Equirment) { updateEquirProfile(model: Equirment) {
this.listEquirment = this.listEquirment.filter((value, key) => { this.listEquirment = this.listEquirment.filter((value, key) => {
if (value.eqId === model.eqId) { if (value.eqId === model.eqId) {
value = model; value = model;
......
...@@ -7,7 +7,7 @@ import { RoomDetail } from '../models/RoomDetail.model'; ...@@ -7,7 +7,7 @@ import { RoomDetail } from '../models/RoomDetail.model';
export class RoomService { export class RoomService {
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
url: string; url: string = ' http://abe9-115-87-232-117.ngrok.io';
listRoomModel: Room[] = [ listRoomModel: Room[] = [
{ {
rId: 1, rId: 1,
...@@ -200,7 +200,17 @@ export class RoomService { ...@@ -200,7 +200,17 @@ export class RoomService {
} }
addRoom(model: Room) { addRoom(model: Room) {
this.listRoomModel.push(model); console.log("model", model)
this.http.post(this.url + "/room/", {
"rName": "wewewe",
"rPic": "assets/img/room.jpg",
"roomLimit": 30,
"rDesc": "จำนวนคน 30 คน",
"rType": "ห้อง"
}).subscribe(response => {
console.log(response);
})
} }
getListRoom() { getListRoom() {
......
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