creation de discussions
This commit is contained in:
@@ -8,7 +8,7 @@ export class ChatService {
|
||||
|
||||
constructor() {
|
||||
this.hub = new HubConnectionBuilder()
|
||||
.withUrl('https://localhost:5001/hubs/chat')
|
||||
.withUrl('https://localhost:5250/hubs/chat')
|
||||
.withAutomaticReconnect()
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ export interface Message {
|
||||
export class discussionsService {
|
||||
|
||||
private http = inject(HttpClient);
|
||||
private apiUrl = 'https://localhost:5250/API';
|
||||
private apiUrl = 'http://localhost:5250';
|
||||
|
||||
getDiscussions(): Observable<Discussion[]> {
|
||||
return this.http.get<Discussion[]>(`${this.apiUrl}/discussions`);
|
||||
return this.http.get<Discussion[]>(`${this.apiUrl}/main/menu`);
|
||||
}
|
||||
|
||||
getMessages(discussionId: string): Observable<Message[]> {
|
||||
return this.http.get<Message[]>(`${this.apiUrl}/discussions/${discussionId}/messages`);
|
||||
return this.http.get<Message[]>(`${this.apiUrl}/messages/${discussionId}`);
|
||||
}
|
||||
|
||||
createPrivateDiscussion(username: string): Observable<Discussion> {
|
||||
|
||||
@@ -5,10 +5,11 @@ import { addIcons } from "ionicons";
|
||||
import { closeOutline } from "ionicons/icons";
|
||||
import { IonIcon, IonInput, IonItem, IonModal } from "@ionic/angular/standalone";
|
||||
import { discussionsService } from "../../../core/chat/discussion.service";
|
||||
import { CommonModule } from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu-nav',
|
||||
imports: [IonModal, IonItem, IonInput, IonIcon, ReactiveFormsModule],
|
||||
imports: [CommonModule, IonModal, IonItem, IonInput, IonIcon, ReactiveFormsModule],
|
||||
templateUrl: './menu-nav.component.html',
|
||||
styleUrl: './menu-nav.component.css'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user