Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 793dd45

Browse files
committed
0.3.7 - Fix news bearer token
1 parent 3baa935 commit 793dd45

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@funixproductions/angular-core",
3-
"version": "0.3.6",
3+
"version": "0.3.7",
44
"description": "Package used in all FunixProductions Angular projects",
55
"scripts": {
66
"ng": "ng",

projects/funixproductions-requests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@funixproductions/funixproductions-requests",
3-
"version": "0.3.6",
3+
"version": "0.3.7",
44
"description": "Package used in all FunixProductions Angular projects",
55
"peerDependencies": {
66
"@angular/common": "^18.2.4",

projects/funixproductions-requests/src/lib/services/pacifista-api/web/news/services/PacifistaNewsCommentService.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,44 @@ export class PacifistaNewsCommentService extends FunixprodHttpClient {
1919
this.path = 'web/news/comments';
2020
}
2121

22-
public getCommentsByNewsId(newsId: string, page: number, authed: boolean = false): Observable<Paginated<PacifistaNewsCommentDTO>> {
22+
public getCommentsByNewsId(newsId: string, page: number): Observable<Paginated<PacifistaNewsCommentDTO>> {
2323
return this.http.get<Paginated<PacifistaNewsCommentDTO>>(this.domain + this.path,
2424
{
2525
params: {
2626
page: page,
2727
newsId: newsId
2828
},
29-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
29+
headers: PacifistaNewsService.getHeadersForGetRequest()
3030
}).pipe(
3131
catchError((error: HttpErrorResponse) => {
3232
return throwError(() => this.buildErrorDto(error));
3333
})
3434
);
3535
}
3636

37-
public getRepliesByCommentId(commentId: string, page: number, authed: boolean = false): Observable<Paginated<PacifistaNewsCommentDTO>> {
37+
public getRepliesByCommentId(commentId: string, page: number): Observable<Paginated<PacifistaNewsCommentDTO>> {
3838
return this.http.get<Paginated<PacifistaNewsCommentDTO>>(this.domain + this.path + '/replies',
3939
{
4040
params: {
4141
page: page,
4242
commentId: commentId
4343
},
44-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
44+
headers: PacifistaNewsService.getHeadersForGetRequest()
4545
}).pipe(
4646
catchError((error: HttpErrorResponse) => {
4747
return throwError(() => this.buildErrorDto(error));
4848
})
4949
);
5050
}
5151

52-
public getCommentsByUser(minecraftUsername: string, page: number, authed: boolean = false): Observable<Paginated<PacifistaNewsCommentDTO>> {
52+
public getCommentsByUser(minecraftUsername: string, page: number): Observable<Paginated<PacifistaNewsCommentDTO>> {
5353
return this.http.get<Paginated<PacifistaNewsCommentDTO>>(this.domain + this.path + '/user',
5454
{
5555
params: {
5656
page: page,
5757
minecraftUsername: minecraftUsername
5858
},
59-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
59+
headers: PacifistaNewsService.getHeadersForGetRequest()
6060
}).pipe(
6161
catchError((error: HttpErrorResponse) => {
6262
return throwError(() => this.buildErrorDto(error));
@@ -91,14 +91,14 @@ export class PacifistaNewsCommentService extends FunixprodHttpClient {
9191
);
9292
}
9393

94-
public getLikesOnComment(commentId: string, page: number, authed: boolean = false): Observable<Paginated<PacifistaNewsCommentLikeDTO>> {
94+
public getLikesOnComment(commentId: string, page: number): Observable<Paginated<PacifistaNewsCommentLikeDTO>> {
9595
return this.http.get<Paginated<PacifistaNewsCommentLikeDTO>>(this.domain + this.path + '/likes',
9696
{
9797
params: {
9898
page: page,
9999
commentId: commentId
100100
},
101-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
101+
headers: PacifistaNewsService.getHeadersForGetRequest()
102102
}).pipe(
103103
catchError((error: HttpErrorResponse) => {
104104
return throwError(() => this.buildErrorDto(error));

projects/funixproductions-requests/src/lib/services/pacifista-api/web/news/services/PacifistaNewsService.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,35 @@ export class PacifistaNewsService extends FunixprodHttpClient {
1818
this.path = 'web/news';
1919
}
2020

21-
public getAllNews(page: number, authed: boolean = false): Observable<Paginated<PacifistaNewsDTO>> {
21+
public getAllNews(page: number): Observable<Paginated<PacifistaNewsDTO>> {
2222
return this.http.get<Paginated<PacifistaNewsDTO>>(this.domain + this.path,
2323
{
2424
params: {
2525
page: page,
2626
},
27-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
27+
headers: PacifistaNewsService.getHeadersForGetRequest()
2828
}).pipe(
2929
catchError((error: HttpErrorResponse) => {
3030
return throwError(() => this.buildErrorDto(error));
3131
})
3232
);
3333
}
3434

35-
public getNewsById(id: string, authed: boolean = false): Observable<PacifistaNewsDTO> {
35+
public getNewsById(id: string): Observable<PacifistaNewsDTO> {
3636
return this.http.get<PacifistaNewsDTO>(this.domain + this.path + '/' + id,
3737
{
38-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
38+
headers: PacifistaNewsService.getHeadersForGetRequest()
3939
}).pipe(
4040
catchError((error: HttpErrorResponse) => {
4141
return throwError(() => this.buildErrorDto(error));
4242
})
4343
);
4444
}
4545

46-
public getNewsByName(name: string, authed: boolean = false): Observable<PacifistaNewsDTO> {
46+
public getNewsByName(name: string): Observable<PacifistaNewsDTO> {
4747
return this.http.get<PacifistaNewsDTO>(this.domain + this.path + '/named/' + name,
4848
{
49-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
49+
headers: PacifistaNewsService.getHeadersForGetRequest()
5050
}).pipe(
5151
catchError((error: HttpErrorResponse) => {
5252
return throwError(() => this.buildErrorDto(error));
@@ -102,13 +102,13 @@ export class PacifistaNewsService extends FunixprodHttpClient {
102102
)
103103
}
104104

105-
public getLikesOnNews(newsId: string, page: number, authed: boolean = false): Observable<Paginated<PacifistaNewsLikeDTO>> {
105+
public getLikesOnNews(newsId: string, page: number): Observable<Paginated<PacifistaNewsLikeDTO>> {
106106
return this.http.get<Paginated<PacifistaNewsLikeDTO>>(this.domain + this.path + '/likes/' + newsId,
107107
{
108108
params: {
109109
page: page,
110110
},
111-
headers: PacifistaNewsService.getHeadersForGetRequest(authed)
111+
headers: PacifistaNewsService.getHeadersForGetRequest()
112112
}).pipe(
113113
catchError((error: HttpErrorResponse) => {
114114
return throwError(() => this.buildErrorDto(error));
@@ -134,8 +134,8 @@ export class PacifistaNewsService extends FunixprodHttpClient {
134134
);
135135
}
136136

137-
static getHeadersForGetRequest(authed: boolean = false): HttpHeaders {
138-
let bearerToken: string | null = authed ? localStorage.getItem(FunixprodHttpClient.accessTokenLocalStorageName) : null;
137+
static getHeadersForGetRequest(): HttpHeaders {
138+
let bearerToken: string | null = localStorage.getItem(FunixprodHttpClient.accessTokenLocalStorageName);
139139
let headersToSend = new HttpHeaders({
140140
'Content-Type': 'application/json'
141141
});

0 commit comments

Comments
 (0)