Skip to content

Commit

Permalink
fixed the loading details
Browse files Browse the repository at this point in the history
  • Loading branch information
Yariki committed Mar 24, 2024
1 parent 085086b commit 746c5a2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
6 changes: 6 additions & 0 deletions dimria-fe/src/Components/AdvertDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ const AdvertDetailsModal = forwardRef<typeof Dialog, AdvertDetailsModalProps>((p
<FlexBox alignItems={FlexBoxAlignItems.Center}>
<Label>City:</Label><Title level={TitleLevel.H6}> {advertDetailsDto?.city_name}</Title>
</FlexBox>
<FlexBox alignItems={FlexBoxAlignItems.Center}>
<Label>Price:</Label><Title level={TitleLevel.H6}> {advertDetailsDto?.price}</Title>
</FlexBox>
<FlexBox alignItems={FlexBoxAlignItems.Center}>
<Label>Currency:</Label><Title level={TitleLevel.H6}> {advertDetailsDto?.currency}</Title>
</FlexBox>
<FlexBox alignItems={FlexBoxAlignItems.Center}>
<Label>Rooms Count:</Label><Title level={TitleLevel.H6}> {advertDetailsDto?.rooms_count}</Title>
</FlexBox>
Expand Down
12 changes: 6 additions & 6 deletions dimria-fe/src/redux/adverts/requests.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from 'axios';

export const fetchAdverts = async (cityId: number) => {
//return await axios.get('https://dimria-advert-prices.azurewebsites.net/api/get_advertisements');
return await axios.get(`http://localhost:7071/api/get_advertisements/${cityId}`);
return await axios.get(`https://dimria-advert-prices.azurewebsites.net/api/get_advertisements/${cityId}`);
//return await axios.get(`http://localhost:7071/api/get_advertisements/${cityId}`);
}

export const fetchAdvertDetails = async (advertId: string) => {
//return await axios.get(`https://dimria-advert-prices.azurewebsites.net/api/get_advert_details/${advertId}`);
return await axios.get(`http://localhost:7071/api/get_advert_details/${advertId}`);
return await axios.get(`https://dimria-advert-prices.azurewebsites.net/api/get_advert_details/${advertId}`);
//return await axios.get(`http://localhost:7071/api/get_advert_details/${advertId}`);
}

export const fetchCities = async () => {
//return await axios.get('https://dimria-advert-prices.azurewebsites.net/api/get_cities');
return await axios.get('http://localhost:7071/api/get_cities');
return await axios.get('https://dimria-advert-prices.azurewebsites.net/api/get_cities');
//return await axios.get('http://localhost:7071/api/get_cities');
}


Expand Down
24 changes: 12 additions & 12 deletions function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@ def get_advert_details(req: func.HttpRequest) -> func.HttpResponse:

resultResponse: AdvertDetailsResponse = AdvertDetailsResponse(
advert_id,
cityName,
price,
rooms_count,
currency_type_uk,
description,
floor,
main_photo,
lat,
lon,
building_name,
url,
photos
city_name=cityName,
price=price,
rooms_count=rooms_count,
currency=currency_type_uk,
description=description,
floor=floor,
main_photo=main_photo,
lat=lat,
lon=lon,
building_name=building_name,
url=url,
photos=photos
)

data = json.dumps(resultResponse, cls=AdvertDetailsResponseEncoder)
Expand Down

0 comments on commit 746c5a2

Please sign in to comment.