Backend < /p>
Код: Выделить всё
[Route("GetByPatient")]
[HttpGet("{id}")]
public async Task GetByPatient(Guid id)
{
Debug.WriteLine(id); // Output: 00000000-0000-0000-0000-000000000000
...
...
< /code>
frontend < /p>
Определение функции < /p>
export const getBookingsByPatient = async (id: string) => {
const url = "http://localhost:5032/bookings/GetByPatient?id=" + id;
console.log(url); // correct url
...
< /code>
Вызов функции < /p>
useEffect(() => {
setBookings([]);
const getBookings = async () => {
// temporary test guid
const tempGuid = "192A59D9-43DF-43EC-943A-8E4290386B1E";
const responce = await getBookingsByPatient(tempGuid );
setBookings(responce);
}
getBookings();
}, []);
Что я делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/796 ... to-backend