17 lines
389 B
JavaScript
17 lines
389 B
JavaScript
import axios from "axios";
|
|
|
|
const API_URL = "https://hopp.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;
|
|
}
|
|
}
|