Skip to content

Commit

Permalink
fix: change api endpoint name
Browse files Browse the repository at this point in the history
  • Loading branch information
FritzHoing committed Jan 16, 2025
1 parent eac8c00 commit f5a1186
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/service/ApplicationService/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('ApplicationService', () => {

const result = await service.findOneByName('TestApp');

expect(fetch).toHaveBeenCalledWith('/applications/name/TestApp', expect.objectContaining({
expect(fetch).toHaveBeenCalledWith('/applications/findByName/TestApp', expect.objectContaining({
method: 'GET',
headers: expect.any(Object),
}));
Expand All @@ -37,7 +37,7 @@ describe('ApplicationService', () => {
});

await expect(service.findOneByName('NonExistentApp')).rejects.toThrow('HTTP error status: 404');
expect(fetch).toHaveBeenCalledWith('/applications/name/NonExistentApp', expect.objectContaining({
expect(fetch).toHaveBeenCalledWith('/applications/findByName/NonExistentApp', expect.objectContaining({
method: 'GET',
headers: expect.any(Object),
}));
Expand All @@ -47,7 +47,7 @@ describe('ApplicationService', () => {
(fetch as jest.Mock).mockRejectedValueOnce(new Error('Network error'));

await expect(service.findOneByName('TestApp')).rejects.toThrow('Error while requesting a single entity: Error: Network error');
expect(fetch).toHaveBeenCalledWith('/applications/name/TestApp', expect.objectContaining({
expect(fetch).toHaveBeenCalledWith('/applications/findByName/TestApp', expect.objectContaining({
method: 'GET',
headers: expect.any(Object),
}));
Expand All @@ -63,7 +63,7 @@ describe('ApplicationService', () => {

const result = await service.findOneByName('TestApp');

expect(fetch).toHaveBeenCalledWith('/applications/name/TestApp', expect.objectContaining({
expect(fetch).toHaveBeenCalledWith('/applications/findByName/TestApp', expect.objectContaining({
method: 'GET',
headers: expect.any(Object),
}));
Expand Down
2 changes: 1 addition & 1 deletion src/service/ApplicationService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class ApplicationService<T extends Application> extends GenericEntityServ

async findOneByName(name: string, fetchOpts?: RequestInit): Promise<T> {
try {
const response = await fetch(`${this.basePath}/name/${name}`, {
const response = await fetch(`${this.basePath}/findByName/${name}`, {
method: 'GET',
headers: {
...getBearerTokenHeader(this.keycloak)
Expand Down

0 comments on commit f5a1186

Please sign in to comment.