Skip to content

Commit

Permalink
fix: url in userservice and console in services
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaam committed Jul 16, 2024
1 parent 3b0e7ce commit c6daf4f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
"globals": {
"vi": true
}
},
{
"files": ["src/services/*.js"],
"rules": {
"no-console": "off"
}
}
]
}
1 change: 0 additions & 1 deletion src/services/breeds.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import { url } from './api';

export const BreedsService = {
Expand Down
4 changes: 3 additions & 1 deletion src/services/user/userService.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { url } from '../api';

export const UserService = {
getPets: async (userId) => {
try {
const response = await fetch(`http://localhost:3000/user/${userId}`);
const response = await fetch(`${url}/${userId}`);

if (!response.ok) {
throw new Error('Ocorreu um erro na requisição');
Expand Down

0 comments on commit c6daf4f

Please sign in to comment.