edit room building
This commit is contained in:
parent
52481cbc4b
commit
a79493d329
|
@ -55,10 +55,9 @@ export class AddEditMasterRoomComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
editForm() {
|
editForm() {
|
||||||
console.log(this.dataRow);
|
|
||||||
|
|
||||||
this.myForm = this.fb.group({
|
this.myForm = this.fb.group({
|
||||||
id: this.dataRow.id,
|
id: this.dataRow.id,
|
||||||
|
roomId: this.dataRow.roomId,
|
||||||
name: [this.dataRow.roomEntity.name, Validators.required],
|
name: [this.dataRow.roomEntity.name, Validators.required],
|
||||||
statusId: [this.dataRow.statusId, Validators.required],
|
statusId: [this.dataRow.statusId, Validators.required],
|
||||||
buildingId: [this.dataRow.buildingId, Validators.required],
|
buildingId: [this.dataRow.buildingId, Validators.required],
|
||||||
|
|
|
@ -109,8 +109,6 @@ export class MasterRoomComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
editRow(row) {
|
editRow(row) {
|
||||||
console.log(row);
|
|
||||||
|
|
||||||
const modalRef = this.modalService.open(AddEditMasterRoomComponent, {
|
const modalRef = this.modalService.open(AddEditMasterRoomComponent, {
|
||||||
size: "lg",
|
size: "lg",
|
||||||
backdrop: "static", // Add this line
|
backdrop: "static", // Add this line
|
||||||
|
@ -122,14 +120,13 @@ export class MasterRoomComponent {
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
console.log(result);
|
|
||||||
const filteredData = {
|
const filteredData = {
|
||||||
id: result.id,
|
id: result.roomId,
|
||||||
name: result.name,
|
name: result.name,
|
||||||
description: result.description,
|
description: result.description,
|
||||||
};
|
};
|
||||||
this.monitoringApiService
|
this.monitoringApiService
|
||||||
.putMasterRoomParam(filteredData, row.id)
|
.putMasterRoomParam(filteredData, row.roomId)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
const transformedData = {
|
const transformedData = {
|
||||||
|
|
Loading…
Reference in New Issue