mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
create room from contatact
This commit is contained in:
@@ -9,6 +9,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
|
||||
|
||||
|
||||
@@ -151,14 +152,23 @@ export class ContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
async createRoom(username: string) {
|
||||
let body = {
|
||||
const result = await this.roomRepositoryService.create({
|
||||
roomName: username,
|
||||
createdBy: SessionStore.user.UserId,
|
||||
roomType: 0,
|
||||
expirationDate: ""
|
||||
expirationDate: null
|
||||
})
|
||||
|
||||
|
||||
console.log(result)
|
||||
|
||||
if(result.isOk()) {
|
||||
|
||||
// this.addGroupMessage.emit(result);
|
||||
|
||||
} else if(result.error instanceof HttpErrorResponse) {
|
||||
|
||||
}
|
||||
let room = await this.roomRepositoryService.create(body)
|
||||
console.log(room)
|
||||
/* this.chatService.createRoom(body).subscribe(res => {
|
||||
|
||||
this.room = res['room'];
|
||||
|
||||
Reference in New Issue
Block a user