Skip to content

Commit

Permalink
Fix bug on synchronize library
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorin95670 committed Oct 11, 2024
1 parent 2af0b9b commit 7af9179
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/services/LibraryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,9 @@ export async function create(url, role) {
export async function synchronize(id, url) {
const api = await prepareRequest();

return api.put(`/libraries/${id}`, { url }).then(({ data }) => data);
return api.put(`/libraries/${id}`, url, {
headers: {
'Content-Type': 'text/plain',
},
}).then(({ data }) => data);
}
6 changes: 5 additions & 1 deletion tests/unit/services/LibraryService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ describe('Test: LibraryService', () => {

const result = await LibraryService.synchronize('id', 'url');

expect(mockPutRequest).toBeCalledWith('/libraries/id', { url: 'url' });
expect(mockPutRequest).toBeCalledWith('/libraries/id', 'url', {
headers: {
'Content-Type': 'text/plain',
},
});
expect(result).toEqual({ id: 1 });
});
});
Expand Down

0 comments on commit 7af9179

Please sign in to comment.