Skip to content
Snippets Groups Projects
Commit 30f027a9 authored by Louis Peter's avatar Louis Peter Committed by Lukas Mauß
Browse files

Trying to update commentThreshold value from room, still not working

parent 2fabd587
No related merge requests found
<form (ngSubmit)="addRoom(longRoomName.value, description.value)"> <form (ngSubmit)="addRoom(longRoomName.value, description.value, -100)">
<div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="10px"> <div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="10px">
<mat-form-field> <mat-form-field>
<input (keypress)="resetEmptyInputs()" matInput #longRoomName class="input-block" type="text" <input (keypress)="resetEmptyInputs()" matInput #longRoomName class="input-block" type="text"
......
...@@ -40,7 +40,7 @@ export class RoomCreateComponent implements OnInit { ...@@ -40,7 +40,7 @@ export class RoomCreateComponent implements OnInit {
this.emptyInputs = false; this.emptyInputs = false;
} }
addRoom(longRoomName: string, description: string) { addRoom(longRoomName: string, description: string, commentThreshold: number) {
longRoomName = longRoomName.trim(); longRoomName = longRoomName.trim();
if (!longRoomName) { if (!longRoomName) {
this.emptyInputs = true; this.emptyInputs = true;
...@@ -49,10 +49,10 @@ export class RoomCreateComponent implements OnInit { ...@@ -49,10 +49,10 @@ export class RoomCreateComponent implements OnInit {
this.roomService.addRoom({ this.roomService.addRoom({
name: longRoomName, name: longRoomName,
abbreviation: '00000000', abbreviation: '00000000',
description: description description: description,
commentThreshold: commentThreshold
} as Room).subscribe(room => { } as Room).subscribe(room => {
this.room = room; this.room = room;
room.commentThreshold = -100;
let msg1: string; let msg1: string;
let msg2: string; let msg2: string;
this.translateService.get('home-page.created-1').subscribe(msg => { msg1 = msg; }); this.translateService.get('home-page.created-1').subscribe(msg => { msg1 = msg; });
......
...@@ -51,7 +51,8 @@ export class RoomService extends BaseHttpService { ...@@ -51,7 +51,8 @@ export class RoomService extends BaseHttpService {
const connectionUrl = this.apiUrl.base + this.apiUrl.rooms + '/'; const connectionUrl = this.apiUrl.base + this.apiUrl.rooms + '/';
return this.http.post<Room>(connectionUrl, { return this.http.post<Room>(connectionUrl, {
ownerId: this.authService.getUser().id, ownerId: this.authService.getUser().id,
abbreviation: room.abbreviation, name: room.name, closed: room.closed, description: room.description abbreviation: room.abbreviation, name: room.name, closed: room.closed, description: room.description,
commentThreshold: room.commentThreshold
}, httpOptions); }, httpOptions);
} }
......
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