LeneS 5 роки тому
джерело
коміт
2983ce80f7

+ 2
- 2
src/components/home/propertySection.vue Переглянути файл

@@ -30,10 +30,10 @@ export default {
30 30
     propertyCard,
31 31
   },
32 32
   computed: {
33
-    ...mapState('property', ['latestProperties']),
33
+    ...mapState('propertySearch', ['latestProperties']),
34 34
   },
35 35
   methods: {
36
-    ...mapActions('property', ['searchLatestProperties']),
36
+    ...mapActions('propertySearch', ['searchLatestProperties']),
37 37
   },
38 38
   mounted() {
39 39
     this.searchLatestProperties();

+ 1
- 1
src/components/misc/contactUs.vue Переглянути файл

@@ -28,7 +28,7 @@
28 28
             width="900"
29 29
             height="450"
30 30
             frameborder="0"
31
-            style="border:0"
31
+            style="border-radius:10px"
32 32
             allowfullscreen
33 33
           ></iframe>
34 34
           <br />

+ 64
- 24
src/components/property/propertySearchFields.vue Переглянути файл

@@ -12,8 +12,8 @@
12 12
           <select
13 13
             class="form-control form-control-lg form-control-a"
14 14
             id="forSelector"
15
-            v-model="selectedType"
16
-            @change="TypeSelected"
15
+            v-model="propertySearch.salesType"
16
+            @change="salesTypeSelected"
17 17
           >
18 18
             <option value="Sale">Sale</option>
19 19
             <option value="Rent">Rent</option>
@@ -31,7 +31,7 @@
31 31
           <select
32 32
             class="form-control form-control-lg form-control-a"
33 33
             id="forSelector"
34
-            v-model="selectedPropertyTypeRes"
34
+            v-model="resType"
35 35
             @change="PropertyTypeSelected"
36 36
           >
37 37
             <option>All</option>
@@ -40,6 +40,11 @@
40 40
               :key="i"
41 41
             >{{ propertyType.description }}</option>
42 42
           </select>
43
+          <div class="input-group-append" @click="clearResType">
44
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
45
+              <b>X</b>
46
+            </span>
47
+          </div>
43 48
         </div>
44 49
       </div>
45 50
       <div v-else class="form-group">
@@ -53,7 +58,7 @@
53 58
           <select
54 59
             class="form-control form-control-lg form-control-a"
55 60
             id="forSelector"
56
-            v-model="selectedPropertyTypeCom"
61
+            v-model="comType"
57 62
             @change="PropertyTypeSelected"
58 63
           >
59 64
             <option>All</option>
@@ -62,6 +67,11 @@
62 67
               :key="i"
63 68
             >{{ propertyType.description }}</option>
64 69
           </select>
70
+          <div class="input-group-append" @click="clearComType">
71
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
72
+              <b>X</b>
73
+            </span>
74
+          </div>
65 75
         </div>
66 76
       </div>
67 77
       <div class="form-group">
@@ -76,11 +86,16 @@
76 86
             class="form-control form-control-lg form-control-a"
77 87
             id="provinceselector"
78 88
             @change="ProvinceSelected"
79
-            v-model="selectedProvince"
89
+            v-model="propertySearch.province"
80 90
           >
81 91
             <option>All</option>
82 92
             <option v-for="(province, i) in provinces" :key="i">{{ province.description }}</option>
83 93
           </select>
94
+          <div class="input-group-append" @click="clearFilter('province')">
95
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
96
+              <b>X</b>
97
+            </span>
98
+          </div>
84 99
         </div>
85 100
       </div>
86 101
     </div>
@@ -97,11 +112,16 @@
97 112
             class="form-control form-control-lg form-control-a"
98 113
             id="cityselector"
99 114
             @change="CitySelected"
100
-            v-model="selectedCity"
115
+            v-model="propertySearch.city"
101 116
           >
102 117
             <option>All</option>
103 118
             <option v-for="(city, i) in cities" :key="i">{{ city.description }}</option>
104 119
           </select>
120
+          <div class="input-group-append" @click="clearFilter('city')">
121
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
122
+              <b>X</b>
123
+            </span>
124
+          </div>
105 125
         </div>
106 126
       </div>
107 127
     </div>
@@ -117,12 +137,17 @@
117 137
           <select
118 138
             class="form-control form-control-lg form-control-a"
119 139
             id="suburbselector"
120
-            v-model="selectedSuburb"
121
-            @change="SuburbSelected"
140
+            v-model="propertySearch.suburb"
141
+            @change="SuburbSeleted"
122 142
           >
123 143
             <option>All</option>
124 144
             <option v-for="(suburb, i) in suburbs" :key="i">{{ suburb.description }}</option>
125 145
           </select>
146
+          <div class="input-group-append" @click="clearFilter('suburb')">
147
+            <span class="input-group-text cursor-pointer" style="color: #60CBEB">
148
+              <b>X</b>
149
+            </span>
150
+          </div>
126 151
         </div>
127 152
       </div>
128 153
     </div>
@@ -138,52 +163,67 @@ export default {
138 163
   },
139 164
   data() {
140 165
     return {
141
-      selectedType: 'Sale',
142
-      selectedProvince: 'All',
143
-      selectedCity: 'All',
144
-      selectedSuburb: 'All',
145
-      selectedPropertyTypeRes: 'All',
146
-      selectedPropertyTypeCom: 'All',
166
+      resType: 'All',
167
+      comType: 'All',
147 168
     };
148 169
   },
149 170
   mounted() {
150 171
     this.getProvince();
151
-    this.$emit('TypeSelectedUpdated', this.selectedType);
152 172
     this.getPropertyTypesRes();
153 173
     this.getPropertyTypesCom();
174
+    this.getPropertySearchObject();
175
+    setTimeout(() => {
176
+      this.propertySearch.propertyUsageType = this.propertyType;
177
+    }, 100);
154 178
   },
155 179
   computed: {
156 180
     ...mapState('searchTab', ['provinces', 'cities', 'suburbs']),
157 181
     ...mapState('property', ['propertyTypesRes', 'propertyTypesCom']),
182
+    ...mapState('propertySearch', ['propertySearch']),
158 183
   },
159 184
   methods: {
160 185
     ...mapActions('searchTab', ['getProvince', 'getCities', 'getSuburbs']),
161 186
     ...mapActions('property', ['getPropertyTypesRes', 'getPropertyTypesCom']),
162
-    TypeSelected(item) {
163
-      this.$emit('TypeSelectedUpdated', item.target.value);
187
+    ...mapActions('propertySearch', ['getPropertySearchObject', 'clearFilter']),
188
+    clearResType() {
189
+      this.clearFilter('propertyType');
190
+      this.resType = 'All';
191
+    },
192
+    clearComType() {
193
+      this.clearFilter('propertyType');
194
+      this.comType = 'All';
195
+    },
196
+    salesTypeSelected() {
197
+      this.$emit('updateSearch', this.propertySearch);
164 198
     },
165 199
     PropertyTypeSelected(item) {
166
-      this.$emit('PropertyTypeSelectedUpdated', item.target.value);
200
+      this.propertySearch.propertyType = item.target.value;
201
+      this.$emit('updateSearch', this.propertySearch);
167 202
     },
168 203
     ProvinceSelected(item) {
169 204
       if (item.target.value !== 'All') {
170
-        this.getCities(Object.assign({}, { province: this.selectedProvince }));
205
+        this.getCities(
206
+          Object.assign({}, { province: this.propertySearch.province }),
207
+        );
171 208
       }
172
-      this.$emit('ProvinceSelectedUpdated', item.target.value);
209
+      this.$emit('updateSearch', this.propertySearch);
173 210
     },
174 211
     CitySelected(item) {
175 212
       if (item.target.value !== 'All') {
176 213
         this.getSuburbs(
177 214
           Object.assign(
178 215
             {},
179
-            { province: this.selectedProvince, city: this.selectedCity },
216
+            {
217
+              province: this.propertySearch.province,
218
+              city: this.propertySearch.city,
219
+            },
180 220
           ),
181 221
         );
182 222
       }
183
-      this.$emit('CitySelectedUpdated', item.target.value);
223
+      this.$emit('updateSearch', this.propertySearch);
184 224
     },
185
-    SuburbSelected(item) {
186
-      this.$emit('SuburbSelectedUpdated', item.target.value);
225
+    SuburbSeleted() {
226
+      this.$emit('updateSearch', this.propertySearch);
187 227
     },
188 228
   },
189 229
 };

+ 82
- 61
src/components/property/propertySearchPage.vue Переглянути файл

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div class="container">
4
-    <div class="container col-md-12" v-if="propertyType === 'Residential'">
4
+    <div class="container col-md-12" v-if="propertySearch.propertyUsageType === 'Residential'">
5 5
       <div class="col-sm-12">
6 6
         <div class="about-img-box">
7 7
           <img
@@ -47,7 +47,7 @@
47 47
         </div>
48 48
         <div class="col-md-4">
49 49
           <p>
50
-            <img class="img-fluid" src="./../../../public/img/residential.jpg" alt="About Resale" />
50
+            <img class="img-fluid" src="./../../../public/img/residential.jpg" alt="About Resale" style="border-radius:10px"/>
51 51
           </p>
52 52
         </div>
53 53
       </div>
@@ -63,7 +63,7 @@
63 63
       <br />
64 64
     </div>
65 65
 
66
-    <div class="container col-md-12" v-if="propertyType === 'Commercial'">
66
+    <div class="container col-md-12" v-if="propertySearch.propertyUsageType === 'Commercial'">
67 67
       <div class="col-sm-12">
68 68
         <div class="about-img-box">
69 69
           <img
@@ -117,12 +117,7 @@
117 117
         </div>
118 118
       </div>
119 119
       <div>
120
-        <propertyCard
121
-          v-if="properties.length > 0"
122
-          name="propertyholder"
123
-          :properties="properties"
124
-          :key="propertysearch"
125
-        />
120
+        <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
126 121
         <div v-if="properties.length === 0">
127 122
           <img src="../../../public/img/no-homes.gif" />
128 123
           <br />
@@ -154,68 +149,94 @@ export default {
154 149
       suburb: '',
155 150
       proptype: '',
156 151
       keyword: '',
152
+      propertySearch: {
153
+        userID: 0,
154
+        keyword: '',
155
+        salesType: 'All',
156
+        propertyUsageType: 'All',
157
+        propertyType: 'All',
158
+        province: 'All',
159
+        city: 'All',
160
+        suburb: 'All',
161
+      },
157 162
     };
158 163
   },
159 164
   methods: {
160
-    ...mapActions('property', [
161
-      'searchPropertiesParams',
162
-      'searchPropertiesKeyword',
163
-    ]),
165
+    ...mapActions('propertySearch', ['searchProperties']),
164 166
   },
165 167
   computed: {
166
-    ...mapState('property', ['properties']),
168
+    ...mapState('propertySearch', ['properties']),
167 169
     ParamsChanged() {
168
-      this.propertyTypeparam = this.$route.params.propertyType;
169
-      this.type = this.$route.query.type;
170
-      this.propertyType = this.$route.query.propertyType;
171
-      this.province = this.$route.query.province;
172
-      this.city = this.$route.query.city;
173
-      this.suburb = this.$route.query.suburb;
174
-      this.proptype = this.$route.query.propType;
175
-      this.keyword = this.$route.query.keyword;
176
-
177
-      if (typeof this.propertyType === 'undefined') {
178
-        this.propertyType = this.propertyTypeparam;
179
-      }
170
+      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
171
+      this.propertySearch = {
172
+        userID: 0,
173
+        keyword: '',
174
+        salesType: 'All',
175
+        propertyUsageType: 'All',
176
+        propertyType: 'All',
177
+        province: 'All',
178
+        city: 'All',
179
+        suburb: 'All',
180
+      };
180 181
 
181
-      if (this.type === '') {
182
-        this.type = 'undefined';
183
-      }
184
-      if (this.propertyType === '') {
185
-        this.propertyType = 'undefined';
186
-      }
187
-      if (this.province === '') {
188
-        this.province = 'undefined';
189
-      }
190
-      if (this.city === '') {
191
-        this.city = 'undefined';
192
-      }
193
-      if (this.suburb === '') {
194
-        this.suburb = 'undefined';
195
-      }
196
-      if (this.proptype === '') {
197
-        this.propType = 'undefined';
198
-      }
199
-      if (typeof this.keyword === 'undefined' || this.keyword === '') {
200
-        this.searchPropertiesParams(
201
-          Object.assign(
202
-            {},
203
-            {
204
-              type: this.type,
205
-              propertyType: this.propertyType,
206
-              province: this.province,
207
-              city: this.city,
208
-              suburb: this.suburb,
209
-              propType: this.proptype,
210
-            },
211
-          ),
212
-        );
182
+      if (typeof this.$route.params.propertyType === 'undefined') {
183
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
184
+        this.propertySearch = this.$route.query;
213 185
       } else {
214
-        this.searchPropertiesKeyword(
215
-          Object.assign({}, { keyword: this.keyword }),
216
-        );
186
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
187
+        this.propertySearch.propertyUsageType = this.$route.params.propertyType;
217 188
       }
218 189
 
190
+      console.log('PropertySearch = ' + JSON.stringify(this.propertySearch));
191
+
192
+      this.searchProperties(this.propertySearch);
193
+      // this.type = this.$route.query.type;
194
+      // this.propertyType = this.$route.query.propertyType;
195
+      // this.province = this.$route.query.province;
196
+      // this.city = this.$route.query.city;
197
+      // this.suburb = this.$route.query.suburb;
198
+      // this.proptype = this.$route.query.propType;
199
+      // this.keyword = this.$route.query.keyword;
200
+      // if (typeof this.propertyType === 'undefined') {
201
+      //   this.propertyType = this.propertyTypeparam;
202
+      // }
203
+      // if (this.type === '') {
204
+      //   this.type = 'undefined';
205
+      // }
206
+      // if (this.propertyType === '') {
207
+      //   this.propertyType = 'undefined';
208
+      // }
209
+      // if (this.province === '') {
210
+      //   this.province = 'undefined';
211
+      // }
212
+      // if (this.city === '') {
213
+      //   this.city = 'undefined';
214
+      // }
215
+      // if (this.suburb === '') {
216
+      //   this.suburb = 'undefined';
217
+      // }
218
+      // if (this.proptype === '') {
219
+      //   this.propType = 'undefined';
220
+      // }
221
+      // if (typeof this.keyword === 'undefined' || this.keyword === '') {
222
+      //   this.searchPropertiesParams(
223
+      //     Object.assign(
224
+      //       {},
225
+      //       {
226
+      //         type: this.type,
227
+      //         propertyType: this.propertyType,
228
+      //         province: this.province,
229
+      //         city: this.city,
230
+      //         suburb: this.suburb,
231
+      //         propType: this.proptype,
232
+      //       },
233
+      //     ),
234
+      //   );
235
+      // } else {
236
+      //   this.searchPropertiesKeyword(
237
+      //     Object.assign({}, { keyword: this.keyword }),
238
+      //   );
239
+      // }
219 240
       return null;
220 241
     },
221 242
   },

+ 4
- 1
src/components/property/propertyeditPage.vue Переглянути файл

@@ -356,7 +356,10 @@ export default {
356 356
       setTimeout(
357 357
         () => this.$router.push({
358 358
             path: '/property/search',
359
-            query: { type: this.salesType, propertyType: this.propertyType },
359
+            query: {
360
+              salesType: this.salesType,
361
+              propertyUsageType: this.propertyType,
362
+            },
360 363
           }),
361 364
         3000,
362 365
       );

+ 21
- 45
src/components/shared/searchTab.vue Переглянути файл

@@ -73,14 +73,7 @@
73 73
                 role="tabpanel"
74 74
                 aria-labelledby="pills-plans-tab"
75 75
               >
76
-                <propertySearch
77
-                  propertyType="Residential"
78
-                  @TypeSelectedUpdated="TypeSelectedUpdated"
79
-                  @ProvinceSelectedUpdated="ProvinceSelectedUpdated"
80
-                  @CitySelectedUpdated="CitySelectedUpdated"
81
-                  @SuburbSelectedUpdated="SuburbSelectedUpdated"
82
-                  @PropertyTypeSelectedUpdated="PropertyTypeSelectedUpdated"
83
-                />
76
+                <propertySearch propertyType="Residential" @updateSearch="updateSearch" />
84 77
               </div>
85 78
               <div
86 79
                 class="tab-pane fade"
@@ -88,18 +81,11 @@
88 81
                 role="tabpanel"
89 82
                 aria-labelledby="pills-map-tab"
90 83
               >
91
-                <propertySearch
92
-                  propertyType="Commercial"
93
-                  @TypeSelectedUpdated="TypeSelectedUpdated"
94
-                  @ProvinceSelectedUpdated="ProvinceSelectedUpdated"
95
-                  @CitySelectedUpdated="CitySelectedUpdated"
96
-                  @SuburbSelectedUpdated="SuburbSelectedUpdated"
97
-                  @PropertyTypeSelectedUpdated="PropertyTypeSelectedUpdated"
98
-                />
84
+                <propertySearch propertyType="Commercial" />
99 85
               </div>
100 86
             </div>
101 87
           </div>
102
-          {{selectedPropertyType}}
88
+          <!-- {{selectedPropertyType}} -->
103 89
           <div class="col-md-12">
104 90
             <button type="submit" class="btn btn-b-n" @click="Search">Search</button>
105 91
           </div>
@@ -110,6 +96,7 @@
110 96
 </template>
111 97
 
112 98
 <script>
99
+import { mapState, mapActions } from 'vuex';
113 100
 import propertySearch from '../property/propertySearchFields.vue';
114 101
 import timeshareSearch from '../timeshare/searchTimeshare.vue';
115 102
 
@@ -121,32 +108,28 @@ export default {
121 108
   data() {
122 109
     return {
123 110
       selectedPropertyType: 'timeshare',
124
-      selectedType: '',
125
-      selectedProvince: '',
126
-      selectedCity: '',
127
-      selectedSuburb: '',
128
-      selectedPropType: '',
129 111
       keyword: '',
112
+      propertySearch: {
113
+        userID: 0,
114
+        keyword: '',
115
+        salesType: 'Sale',
116
+        propertyUsageType: 'All',
117
+        propertyType: 'All',
118
+        province: 'All',
119
+        city: 'All',
120
+        suburb: 'All',
121
+      },
130 122
     };
131 123
   },
124
+  computed: {},
132 125
   methods: {
133 126
     updateType(item) {
134 127
       this.selectedPropertyType = item;
135 128
     },
136
-    TypeSelectedUpdated(item) {
137
-      this.selectedType = item;
138
-    },
139
-    PropertyTypeSelectedUpdated(item) {
140
-      this.selectedPropType = item;
141
-    },
142
-    ProvinceSelectedUpdated(item) {
143
-      this.selectedProvince = item;
144
-    },
145
-    CitySelectedUpdated(item) {
146
-      this.selectedCity = item;
147
-    },
148
-    SuburbSelectedUpdated(item) {
149
-      this.selectedSuburb = item;
129
+    updateSearch(item) {
130
+      this.propertySearch = item;
131
+      this.propertySearch.propertyUsageType = this.selectedPropertyType;
132
+      this.propertySearch.keyword = this.keyword;
150 133
     },
151 134
     Search() {
152 135
       if (this.selectedPropertyType === 'timeshare') {
@@ -154,16 +137,9 @@ export default {
154 137
       } else {
155 138
         this.$router.push({
156 139
           path: '/property/search',
157
-          query: {
158
-            type: this.selectedType,
159
-            propertyType: this.selectedPropertyType,
160
-            province: this.selectedProvince,
161
-            city: this.selectedCity,
162
-            suburb: this.selectedSuburb,
163
-            propType: this.selectedPropType,
164
-            keyword: this.keyword,
165
-          },
140
+          query: this.propertySearch,
166 141
         });
142
+        // this.$router.push('/property/search');
167 143
       }
168 144
     },
169 145
   },

+ 2
- 0
src/store/index.js Переглянути файл

@@ -17,6 +17,7 @@ import Register from './modules/user/register';
17 17
 import WeekList from './modules/timeshare/weekList';
18 18
 import Bid from './modules/processFlow/bid';
19 19
 import Authentication from './modules/user/authentication';
20
+import PropertySearch from './modules/property/propertySearch';
20 21
 
21 22
 Vue.use(Vuex);
22 23
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -39,5 +40,6 @@ export default new Vuex.Store({
39 40
     weekList: WeekList,
40 41
     bid: Bid,
41 42
     authentication: Authentication,
43
+    propertySearch: PropertySearch,
42 44
   },
43 45
 });

+ 0
- 31
src/store/modules/property/property.js Переглянути файл

@@ -31,8 +31,6 @@ export default {
31 31
     propertyTypesCom: [],
32 32
     propertyOverviewFields: [],
33 33
     propertyFields: [],
34
-    properties: [],
35
-    latestProperties: [],
36 34
   },
37 35
   mutations: {
38 36
     setProperty(state, property) {
@@ -59,12 +57,6 @@ export default {
59 57
     updateCurrentProperty(state, property) {
60 58
       state.properties.push(property);
61 59
     },
62
-    updateSearch(state, propertySearch) {
63
-      state.properties = propertySearch;
64
-    },
65
-    setLatestProperties(state, properties) {
66
-      state.latestProperties = properties;
67
-    },
68 60
     clearProperty(state) {
69 61
       state.property = {
70 62
         createdBy: '',
@@ -92,9 +84,6 @@ export default {
92 84
     clearPropertyImages(state) {
93 85
       state.propertyImages = [];
94 86
     },
95
-    setProperties(state, properties) {
96
-      state.properties = properties;
97
-    },
98 87
   },
99 88
   getters: {},
100 89
   actions: {
@@ -156,26 +145,6 @@ export default {
156 145
         .then(result => commit('updateCurrentProperty', result.data))
157 146
         .catch(console.error);
158 147
     },
159
-    searchPropertiesParams({ commit }, item) {
160
-      axios
161
-        .get(
162
-          `/api/property/search/${item.type}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.propType}`,
163
-        )
164
-        .then(response => commit('updateSearch', response.data))
165
-        .catch(console.error);
166
-    },
167
-    searchPropertiesKeyword({ commit }, item) {
168
-      axios
169
-        .get(`/api/Property/Search/${item.keyword}`)
170
-        .then(response => commit('updateSearch', response.data))
171
-        .catch(console.error);
172
-    },
173
-    searchLatestProperties({ commit }) {
174
-      axios
175
-        .get('/api/property/latestProperties')
176
-        .then(response => commit('setLatestProperties', response.data))
177
-        .catch(console.error);
178
-    },
179 148
     clearProperty({ commit }) {
180 149
       commit('clearProperty');
181 150
     },

+ 65
- 0
src/store/modules/property/propertySearch.js Переглянути файл

@@ -0,0 +1,65 @@
1
+import axios from 'axios';
2
+
3
+export default {
4
+  namespaced: true,
5
+  state: {
6
+    propertySearch: {
7
+      userID: 0,
8
+      keyword: '',
9
+      salesType: 'Sale',
10
+      propertyUsageType: 'All',
11
+      propertyType: 'All',
12
+      province: 'All',
13
+      city: 'All',
14
+      suburb: 'All',
15
+    },
16
+    properties: [],
17
+    latestProperties: [],
18
+  },
19
+  mutations: {
20
+    updateSearch(state, propertySearch) {
21
+      state.properties = [];
22
+      state.properties = propertySearch;
23
+    },
24
+    setLatestProperties(state, properties) {
25
+      state.latestProperties = properties;
26
+    },
27
+    setPropertySearch(state, search) {
28
+      state.propertySearch = search;
29
+    },
30
+    onClearFilter(state, filter) {
31
+      state.propertySearch[filter] = 'All';
32
+    },
33
+  },
34
+  getters: {},
35
+  actions: {
36
+    clearFilter({ commit }, filter) {
37
+      commit('onClearFilter', filter);
38
+    },
39
+    getPropertySearchObject({ commit }) {
40
+      const search = {
41
+        userID: 0,
42
+        keyword: '',
43
+        salesType: 'Sale',
44
+        propertyUsageType: 'All',
45
+        propertyType: 'All',
46
+        province: 'All',
47
+        city: 'All',
48
+        suburb: 'All',
49
+      };
50
+      commit('setPropertySearch', search);
51
+    },
52
+    searchProperties({ commit }, item) {
53
+      axios
54
+        .post('/api/Property/Search', item)
55
+        .then(result => commit('updateSearch', result.data))
56
+        .catch(console.error);
57
+    },
58
+    searchLatestProperties({ commit }) {
59
+      axios
60
+        .get('/api/property/latestProperties')
61
+        .then(response => commit('setLatestProperties', response.data))
62
+        .catch(console.error);
63
+    },
64
+  },
65
+};

Завантаження…
Відмінити
Зберегти