Compare commits
2 Commits
aec268fbce
...
e386897dc9
| Author | SHA1 | Date | |
|---|---|---|---|
| e386897dc9 | |||
| 79cb219a38 |
@@ -8,7 +8,7 @@ export class ChatService {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.hub = new HubConnectionBuilder()
|
this.hub = new HubConnectionBuilder()
|
||||||
.withUrl('https://localhost:5001/hubs/chat')
|
.withUrl('https://localhost:5250/hubs/chat')
|
||||||
.withAutomaticReconnect()
|
.withAutomaticReconnect()
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ export interface Message {
|
|||||||
export class discussionsService {
|
export class discussionsService {
|
||||||
|
|
||||||
private http = inject(HttpClient);
|
private http = inject(HttpClient);
|
||||||
private apiUrl = 'https://localhost:5250/API';
|
private apiUrl = 'http://localhost:5250';
|
||||||
|
|
||||||
getDiscussions(): Observable<Discussion[]> {
|
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[]> {
|
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> {
|
createPrivateDiscussion(username: string): Observable<Discussion> {
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import { addIcons } from "ionicons";
|
|||||||
import { closeOutline } from "ionicons/icons";
|
import { closeOutline } from "ionicons/icons";
|
||||||
import { IonIcon, IonInput, IonItem, IonModal } from "@ionic/angular/standalone";
|
import { IonIcon, IonInput, IonItem, IonModal } from "@ionic/angular/standalone";
|
||||||
import { discussionsService } from "../../../core/chat/discussion.service";
|
import { discussionsService } from "../../../core/chat/discussion.service";
|
||||||
|
import { CommonModule } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-menu-nav',
|
selector: 'app-menu-nav',
|
||||||
imports: [IonModal, IonItem, IonInput, IonIcon, ReactiveFormsModule],
|
imports: [CommonModule, IonModal, IonItem, IonInput, IonIcon, ReactiveFormsModule],
|
||||||
templateUrl: './menu-nav.component.html',
|
templateUrl: './menu-nav.component.html',
|
||||||
styleUrl: './menu-nav.component.css'
|
styleUrl: './menu-nav.component.css'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user