Skip to content

Commit f81789f

Browse files
committed
remove trailing slash for articles route
1 parent f39866e commit f81789f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

e2e/error-handling.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ test.describe('Error Handling - Network Errors', () => {
626626
});
627627
});
628628
// Network error on article creation
629-
await page.route(`${API_BASE}/articles/`, route => {
629+
await page.route(`${API_BASE}/articles`, route => {
630630
route.abort('internetdisconnected');
631631
});
632632
await page.goto('/');

src/app/features/article/services/articles.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ describe('ArticlesService', () => {
200200
tagList: ['new', 'test'],
201201
};
202202
const promise = firstValueFrom(service.create(newArticle));
203-
const req = httpMock.expectOne('/articles/');
203+
const req = httpMock.expectOne('/articles');
204204
expect(req.request.method).toBe('POST');
205205
expect(req.request.body).toEqual({ article: newArticle });
206206
req.flush({ article: { ...mockArticle, ...newArticle } });
@@ -216,7 +216,7 @@ describe('ArticlesService', () => {
216216
};
217217
const errorResponse = { status: 422, statusText: 'Unprocessable Entity' };
218218
const promise = firstValueFrom(service.create(invalidArticle));
219-
const req = httpMock.expectOne('/articles/');
219+
const req = httpMock.expectOne('/articles');
220220
req.flush('Validation failed', errorResponse);
221221
await expect(promise).rejects.toMatchObject({ status: 422 });
222222
});

src/app/features/article/services/articles.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class ArticlesService {
3333
}
3434

3535
create(article: Partial<Article>): Observable<Article> {
36-
return this.http.post<{ article: Article }>('/articles/', { article: article }).pipe(map(data => data.article));
36+
return this.http.post<{ article: Article }>('/articles', { article: article }).pipe(map(data => data.article));
3737
}
3838

3939
update(article: Partial<Article>): Observable<Article> {

0 commit comments

Comments
 (0)