Commit d0f3a000 by Your Name

update url

parent 5173de1e
......@@ -64,7 +64,6 @@ export class AdminEquirmentComponent implements OnInit {
this.listRoomModel = this.roomService.getListRoom();
this.collectionSizeListRoom = this.listRoomModel.length
this.collectionSize = this.listEquirmentModel.length
console.log("listRoom", this.listRoomModel)
this.myFormRoom = new FormGroup({
userNameForm : new FormControl('',[Validators.required]),
rTelephone : new FormControl('',[Validators.required]),
......
......@@ -7,7 +7,7 @@ import { ItemDetail } from '../models/itemDetail.model';
export class EquirmentService {
constructor(private http: HttpClient) { }
url: string;
url: string = " http://abe9-115-87-232-117.ngrok.io";
listEquirment: Equirment[] = [
{
eqId: 1,
......@@ -152,7 +152,18 @@ export class EquirmentService {
]
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){
......@@ -206,13 +217,13 @@ export class EquirmentService {
})
}
updateEquirProfile(model : Equirment) {
updateEquirProfile(model: Equirment) {
this.listEquirment = this.listEquirment.filter((value, key) => {
if (value.eqId === model.eqId) {
value = model;
value = model;
}
return true;
});
});
}
deleteEquirProfile(row_obj: Equirment) {
......
......@@ -7,7 +7,7 @@ import { RoomDetail } from '../models/RoomDetail.model';
export class RoomService {
constructor(private http: HttpClient) { }
url: string;
url: string = ' http://abe9-115-87-232-117.ngrok.io';
listRoomModel: Room[] = [
{
rId: 1,
......@@ -200,7 +200,17 @@ export class RoomService {
}
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() {
......
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