Apartments
File Name : apartments.js File Path : /server/routes/apartments.js This route is used to handle user's apartment related queries. For example: creating an apartment, updating apartment details, fetching apartments, fetching filtered apartments, delete apartment etc.
Get Apartments
GET
/api/apartments
Headers
Authorization
string
Authentication token
Create Apartment (Flat)
POST
/api/apartments
Headers
Authorization
string
Authentication Token
Request Body
userId
string
User Id
address
string
address of the locality of flat
gpsLoc
array
location array [lat, lng]
availableFrom
string
date from flat is available
houseSize
string
size of the flat
spaceFor
number
space for how many members
monthlyRent
number
monthly rent
oneTimeDeposit
number
one time deposit
occupancyType
string
occupancy type
amenities
array
amenities array
pictures
array
pictures array
description
string
Description
Update Apartment
PUT
/api/apartments/?id=${_id}
Headers
updateObj
object
updateObj contains type of the details to be modified and details obj.
Authorization
string
Authentication Token
Get filtered Apartments
GET
/api/apartments/filterdApartments
Headers
filterObject
object
Contains the filter details
Authorization
string
Authentication Token
Delete Apartment
GET
/api/apartments/deleteApartment/?id=${id}
Headers
Authorization
string
Authentication Token
Last updated
Was this helpful?