From 080d1e0ffc66b0227c2eddd2e00484cecb1ffeb6 Mon Sep 17 00:00:00 2001 From: b1ek Date: Mon, 8 May 2023 23:32:10 +1000 Subject: [PATCH] use class for types --- pairent_frontend_react/src/API/Apartment.js | 27 +++++++++++++++++++ .../src/components/CardApartament/index.jsx | 15 +---------- 2 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 pairent_frontend_react/src/API/Apartment.js diff --git a/pairent_frontend_react/src/API/Apartment.js b/pairent_frontend_react/src/API/Apartment.js new file mode 100644 index 0000000..3f5bc72 --- /dev/null +++ b/pairent_frontend_react/src/API/Apartment.js @@ -0,0 +1,27 @@ +/** + * Apartment class model + */ +class Apartment { + /** @type {string} */ + perimetrs + /** @type {string} */ + rooms + /** @type {string} */ + address + /** @type {string} */ + floor + /** @type {string} */ + floorHouse + /** @type {string} */ + timeToBus + /** @type {string} */ + timeToTrain + /** @type {string} */ + price + /** @type {string} */ + description + /** @type {string} */ + dateCreate +} + +export { Apartment } \ No newline at end of file diff --git a/pairent_frontend_react/src/components/CardApartament/index.jsx b/pairent_frontend_react/src/components/CardApartament/index.jsx index f6296f3..9813e37 100644 --- a/pairent_frontend_react/src/components/CardApartament/index.jsx +++ b/pairent_frontend_react/src/components/CardApartament/index.jsx @@ -141,20 +141,7 @@ const PriceArrow = (props) => { } /** - * @param {{ - * results: { - * perimetrs: string, - * rooms: string, - * address: string, - * floor: string, - * floorHouse: string, - * timeToBus: string, - * timeToTrain: string, - * price: string, - * description: string, - * dateCreate: string - * } - * }} props + * @param {{ results: import('../../API/Apartment').Apartment }} props */ const CardApartament = function (props) { return (