Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getAddress = (e: ILocationDetailsDto): string => {
- e.street = "Octowa";
- e.apartmentNumber = "21";
- e.streetNumber = "12";
- let address = e.street;
- if (e.street) address = e.street ? e.street : e.city;
- if (e.streetNumber) address = address + ", " + e.streetNumber;
- if (e.streetNumber && e.apartmentNumber) address = address + " / " + e.apartmentNumber;
- else if (e.apartmentNumber) address = address + ", " + e.apartmentNumber;
- return address;
- };
- useEffect(() => {
- async function x() {
- if (id) {
- const e = await fetchEntity(id);
- if (e) {
- e.address = getAddress(e);
- setEntity(e);
- } else setNoData(true);
- }
- }
- x();
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement