Место общения программистов C#
-
Anonymous
Пустое гид идет на бэкэнд
Сообщение
Anonymous »
Web API + Nextts < /p>
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
1751448396
Anonymous
Web API + Nextts < /p>
Backend < /p>
[code][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();
}, []);
[/code]
нет ошибок, просто пустое руководство.
Что я делаю не так?
Подробнее здесь: [url]https://stackoverflow.com/questions/79687009/empty-guid-is-coming-to-backend[/url]