Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ A mobile social media guessing game app
- Sync ionic with `ionic cap sync` or via the plugin
- To use the native Run commands of the ionic plugin (Android/IOS) it is necessary to install Android Studio and XCode
- It is possible that your SDK is not defined. Find a help here: [https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil](https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil)

2 changes: 1 addition & 1 deletion src/app/home/tabs/network/network.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3>Follow Requests</h3>
@for(item of networkState.followRequests(); track item.requesterId) {
<ion-card>
<ion-card-header>
<ion-card-title>{{ item.requesterId }}</ion-card-title>
<ion-card-title>{{ item.requesterUsername }}</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-button
Expand Down
2 changes: 2 additions & 0 deletions src/app/model/follow-request.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export type FollowRequestDto = {
requester_username: string;
requester_id: string;
requestee_id: string;
status: string;
timestamp: string;
};

export type FollowRequest = {
requesterUsername: string
requesterId: string;
requesteeId: string;
status: string;
Expand Down
5 changes: 3 additions & 2 deletions src/app/services/api/follow-requests-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class FollowRequestsApiService {
map((requests) => {
return requests.map((request) => {
return {
requesterUsername: request.requester_username,
requesterId: request.requester_id,
requesteeId: request.requestee_id,
status: request.status,
Expand All @@ -39,14 +40,14 @@ export class FollowRequestsApiService {
}

acceptFollowRequest(userId: string): Observable<void> {
return this.http.put<void>(
return this.http.patch<void>(
`${environment.api.url}/users/${userId}/follow?action=accept`,
{}
);
}

declineFollowRequest(userId: string): Observable<void> {
return this.http.put<void>(
return this.http.patch<void>(
`${environment.api.url}/users/${userId}/follow?action=decline`,
{}
);
Expand Down