V1
This commit is contained in:
13
ArtisanConnect/api/client.jsx
Normal file
13
ArtisanConnect/api/client.jsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import axios from "axios";
|
||||
|
||||
const API_URL = "https://testowe.zikor.pl/api/v1";
|
||||
|
||||
export async function getUserById(userId) {
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/clients/get/${userId}`);
|
||||
return response.data;
|
||||
} catch (err) {
|
||||
console.error(`Nie udało się pobrać danych użytkownika o ID ${userId}.`, err.response.status);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user