This commit is contained in:
omkieit 2024-09-23 22:04:21 +05:30
parent bff2eb2041
commit 57af157957
4 changed files with 87 additions and 32 deletions

View File

@ -1,6 +1,9 @@
import mongoose from "mongoose";
const propertySchema = mongoose.Schema({
address: {type: String, required: true },
city: {type: String, required: true },
state: {type: String, required: true },
propertyType: {type: String, required: true },
title: {type: String, required: true },
yearBuild: {type: String, required: true },

File diff suppressed because one or more lines are too long

View File

@ -45,7 +45,7 @@
<script type="module" crossorigin src="/assets/index-CLTkCQKH.js"></script>
<script type="module" crossorigin src="/assets/index-CfJjKeZO.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CAj3mSy-.css">
</head>

View File

@ -22,6 +22,9 @@ const Addproperty = () => {
const { user } = useSelector((state) => ({ ...state.auth }));
const [formData, setFormData] = useState({
address:"",
city:"",
state:"",
propertyType: "",
title: "",
yearBuild: "",
@ -39,6 +42,9 @@ const Addproperty = () => {
const handleSubmit = () => {
if (
formData.address &&
formData.city &&
formData.state &&
formData.propertyType &&
formData.title &&
formData.yearBuild &&
@ -52,7 +58,7 @@ const Addproperty = () => {
userlastname: user?.result?.lastName,
usertitle: user?.result?.title,
useremail: user?.result?.email,
userId:user?.result?.userId,
userId: user?.result?.userId,
};
// Dispatch the form data with user info
@ -111,10 +117,59 @@ const Addproperty = () => {
<div className="tab-content">
{activeTab === "propertydetails" && (
<div role="tabpanel" className="tab-pane active">
<h3>Property Details</h3>
<form>
<div className="row gy-3 overflow-hidden">
<div className="col-12">
<h3>Property Location</h3>
<div className="row gy-3">
<div className="col-md-4">
<div className="form-floating mb-3">
<input
type="text"
className="form-control"
name="address"
placeholder="Property Address"
value={formData.address}
onChange={handleInputChange}
required
/>
<label htmlFor="title">Property Address</label>
</div>
</div>
<div className="col-md-4">
<div className="form-floating mb-3">
<input
type="text"
className="form-control"
name="city"
value={formData.city}
onChange={handleInputChange}
placeholder="city"
required
/>
<label htmlFor="title">City</label>
</div>
</div>
<div className="col-md-4">
<select
className="form-floating mb-3 form-control"
name="state"
value={formData.state}
onChange={handleInputChange}
required
>
<option value="">Please Select State</option>
<option value="Residential">Residential</option>
<option value="Land">Land</option>
<option value="Commercial">Commercial</option>
<option value="Industrial">Industrial</option>
<option value="Water">Water</option>
</select>
</div>
</div>
<div className="row gy-3">
<div className="col-md-4">
<select
className="form-floating mb-3 form-control"
name="propertyType"
@ -130,7 +185,7 @@ const Addproperty = () => {
<option value="Water">Water</option>
</select>
</div>
<div className="col-12">
<div className="col-md-4">
<div className="form-floating mb-3">
<input
type="text"
@ -138,15 +193,13 @@ const Addproperty = () => {
name="title"
value={formData.title}
onChange={handleInputChange}
placeholder="Property title"
placeholder="Property Title"
required
/>
<label htmlFor="title" className="form-label">
Property Title
</label>
<label htmlFor="title">Property Title</label>
</div>
</div>
<div className="col-12">
<div className="col-md-4">
<div className="form-floating mb-3">
<input
type="text"
@ -154,15 +207,16 @@ const Addproperty = () => {
name="yearBuild"
value={formData.yearBuild}
onChange={handleInputChange}
placeholder="Year build"
placeholder="Year Build"
required
/>
<label htmlFor="yearBuild" className="form-label">
Year Build
</label>
<label htmlFor="yearBuild">Year Build</label>
</div>
</div>
</div>
</form>
<button
className="btn btn-primary continue"
@ -177,8 +231,8 @@ const Addproperty = () => {
<div role="tabpanel" className="tab-pane active">
<h3>Shipping Address</h3>
<form>
<div className="row gy-3 overflow-hidden">
<div className="col-12">
<div className="row gy-3">
<div className="col-md-4">
<div className="form-floating mb-3">
<input
type="text"
@ -189,9 +243,7 @@ const Addproperty = () => {
placeholder="Total SQFT"
required
/>
<label htmlFor="totalSqft" className="form-label">
Total SQFT
</label>
<label htmlFor="totalSqft">Total SQFT</label>
</div>
</div>
</div>