Quellcode durchsuchen

changes to proxy & editing + other

master
George Williams vor 5 Jahren
Ursprung
Commit
e276b9552b

+ 1
- 0
src/components/home/propertySection.vue Datei anzeigen

@@ -15,6 +15,7 @@
15 15
           v-if="latestProperties.length > 0"
16 16
           name="propertyholder"
17 17
           :properties="latestProperties"
18
+          :showSort="false"
18 19
         />
19 20
       </div>
20 21
     </section>

+ 116
- 63
src/components/property/propertyCard.vue Datei anzeigen

@@ -1,74 +1,97 @@
1 1
 <template>
2
-  <div class="form-group row">
3
-    <div class="col-md-4" v-for="currentProperty in properties" :key="currentProperty.id">
4
-      <div class="card-box-a card-shadow">
5
-        <div class="img-box-a">
6
-          <img
7
-            :src="currentProperty.displayImage"
8
-            alt
9
-            class="img-a img-fluid"
10
-            style="height:466px; width:350px; object-fit: cover;"
11
-          />
12
-        </div>
13
-        <div class="card-overlay">
14
-          <div class="card-overlay-a-content">
15
-            <div class="card-header-a">
16
-              <h4 class="card-title-a">
17
-                <router-link
18
-                  :to="`/property/property/${currentProperty.id}`"
19
-                  class="link-a"
20
-                >{{ currentProperty.shortDescription }}</router-link>
21
-              </h4>
22
-              <h4 class="card-title-c">
2
+  <div>
3
+    <div class="form-group row" v-if="showSort">
4
+      <button
5
+        type="button"
6
+        class="btn btn-link font-weight-bold color-b"
7
+        style="width: 150px; height:40px;"
8
+        @click="sortNewest()"
9
+      >Newest</button>
10
+      <button
11
+        type="button"
12
+        class="btn btn-link font-weight-bold color-b"
13
+        style="width: 150px; height:40px;"
14
+        @click="sortLowPrice()"
15
+      >Lowest Price</button>
16
+      <button
17
+        type="button"
18
+        class="btn btn-link font-weight-bold color-b"
19
+        style="width: 150px; height:40px;"
20
+        @click="sortHighPrice()"
21
+      >Highest Price</button>
22
+      <hr />
23
+    </div>
24
+    <div class="form-group row">
25
+      <div class="col-md-4" v-for="currentProperty in properties" :key="currentProperty.id">
26
+        <div class="card-box-a card-shadow">
27
+          <div class="img-box-a">
28
+            <img
29
+              :src="currentProperty.displayImage"
30
+              alt
31
+              class="img-a img-fluid"
32
+              style="height:466px; width:350px; object-fit: cover;"
33
+            />
34
+          </div>
35
+          <div class="card-overlay">
36
+            <div class="card-overlay-a-content">
37
+              <div class="card-header-a">
38
+                <h4 class="card-title-a">
39
+                  <router-link
40
+                    :to="`/property/property/${currentProperty.id}`"
41
+                    class="link-a"
42
+                  >{{ currentProperty.shortDescription }}</router-link>
43
+                </h4>
44
+                <h4 class="card-title-c">
45
+                  <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
46
+                    {{ currentProperty.province }}
47
+                    <br />
48
+                    {{ currentProperty.city }}
49
+                    <br />
50
+                    {{ currentProperty.suburb }}
51
+                  </router-link>
52
+                </h4>
53
+              </div>
54
+              <div class="card-body-a">
55
+                <div class="price-box d-flex">
56
+                  <span
57
+                    v-if="currentProperty.isSale"
58
+                    class="price-a"
59
+                  >sale | {{ currentProperty.displayPrice }}</span>
60
+                  <span
61
+                    v-if="!currentProperty.isSale"
62
+                    class="price-a"
63
+                  >rent | {{ currentProperty.displayPrice }}</span>
64
+                </div>
23 65
                 <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
24
-                  {{ currentProperty.province }}
25
-                  <br />
26
-                  {{ currentProperty.city }}
27
-                  <br />
28
-                  {{ currentProperty.suburb }}
66
+                  Click here to view
67
+                  <span class="ion-ios-arrow-forward"></span>
29 68
                 </router-link>
30
-              </h4>
31
-            </div>
32
-            <div class="card-body-a">
33
-              <div class="price-box d-flex">
34
-                <span
35
-                  v-if="currentProperty.isSale"
36
-                  class="price-a"
37
-                >sale | {{ currentProperty.displayPrice }}</span>
38
-                <span
39
-                  v-if="!currentProperty.isSale"
40
-                  class="price-a"
41
-                >rent | {{ currentProperty.displayPrice }}</span>
42 69
               </div>
43
-              <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
44
-                Click here to view
45
-                <span class="ion-ios-arrow-forward"></span>
46
-              </router-link>
47
-            </div>
48
-            <div class="card-footer-a" v-if="currentProperty.showFooter">
49
-              <ul class="card-info d-flex justify-content-around">
50
-                <li v-if="currentProperty.area !== null">
51
-                  <h4 class="card-info-title">Area</h4>
52
-                  <span v-html="currentProperty.area"></span>
53
-                </li>
54
-                <li v-if="currentProperty.beds !== null">
55
-                  <h4 class="card-info-title">Beds</h4>
56
-                  <span>{{ currentProperty.beds }}</span>
57
-                </li>
58
-                <li v-if="currentProperty.baths !== null">
59
-                  <h4 class="card-info-title">Baths</h4>
60
-                  <span>{{ currentProperty.baths }}</span>
61
-                </li>
62
-                <li v-if="currentProperty.garages !== null">
63
-                  <h4 class="card-info-title">Garages</h4>
64
-                  <span>{{ currentProperty.garages }}</span>
65
-                </li>
66
-              </ul>
70
+              <div class="card-footer-a" v-if="currentProperty.showFooter">
71
+                <ul class="card-info d-flex justify-content-around">
72
+                  <li v-if="currentProperty.area !== null">
73
+                    <h4 class="card-info-title">Area</h4>
74
+                    <span v-html="currentProperty.area"></span>
75
+                  </li>
76
+                  <li v-if="currentProperty.beds !== null">
77
+                    <h4 class="card-info-title">Beds</h4>
78
+                    <span>{{ currentProperty.beds }}</span>
79
+                  </li>
80
+                  <li v-if="currentProperty.baths !== null">
81
+                    <h4 class="card-info-title">Baths</h4>
82
+                    <span>{{ currentProperty.baths }}</span>
83
+                  </li>
84
+                  <li v-if="currentProperty.garages !== null">
85
+                    <h4 class="card-info-title">Garages</h4>
86
+                    <span>{{ currentProperty.garages }}</span>
87
+                  </li>
88
+                </ul>
89
+              </div>
67 90
             </div>
68 91
           </div>
69 92
         </div>
93
+        <br />
70 94
       </div>
71
-      <br />
72 95
     </div>
73 96
   </div>
74 97
 </template>
@@ -77,6 +100,36 @@
77 100
 export default {
78 101
   props: {
79 102
     properties: { type: Array, default: () => [] },
103
+    showSort: { type: Boolean, default: true },
104
+  },
105
+  methods: {
106
+    sortHighPrice() {
107
+      function compare(a, b) {
108
+        if (a.price < b.price) return 1;
109
+        if (a.price > b.price) return -1;
110
+        return 0;
111
+      }
112
+
113
+      return this.properties.sort(compare);
114
+    },
115
+    sortLowPrice() {
116
+      function compare(a, b) {
117
+        if (a.price < b.price) return -1;
118
+        if (a.price > b.price) return 1;
119
+        return 0;
120
+      }
121
+
122
+      return this.properties.sort(compare);
123
+    },
124
+    sortNewest() {
125
+      function compare(a, b) {
126
+        if (a.dateCreated < b.dateCreated) return 1;
127
+        if (a.dateCreated > b.dateCreated) return -1;
128
+        return 0;
129
+      }
130
+
131
+      return this.properties.sort(compare);
132
+    },
80 133
   },
81 134
 };
82 135
 </script>

+ 14
- 10
src/components/property/propertyImage.vue Datei anzeigen

@@ -31,7 +31,6 @@
31 31
 export default {
32 32
   props: {
33 33
     loadedImages: Function,
34
-    savedImages: { type: Array, default: () => [] },
35 34
   },
36 35
   data() {
37 36
     return {
@@ -40,11 +39,14 @@ export default {
40 39
       imagesDefault: [],
41 40
     };
42 41
   },
43
-  mounted() {
44
-    if (this.savedImages.length > 0) {
45
-      this.image = this.savedImages;
46
-    }
47
-  },
42
+  // Commented out for now.
43
+  // created() {
44
+  //   if (this.savedImages && this.savedImages.length > 0) {
45
+  //     this.savedImages.forEach((element) => {
46
+  //       this.images.push(element);
47
+  //     });
48
+  //   }
49
+  // },
48 50
   methods: {
49 51
     imagesAdd(e) {
50 52
       const files = e.target.files || e.dataTransfer.files;
@@ -79,12 +81,14 @@ export default {
79 81
     },
80 82
 
81 83
     updateList(index) {
82
-      for (let i = 0; i < this.imagesDefault.length; i++) {
83
-        if (i !== index) {
84
-          this.imagesDefault[i] = false;
84
+      if (this.imagesDefault) {
85
+        for (let i = 0; i < this.imagesDefault.length; i++) {
86
+          if (i !== index) {
87
+            this.imagesDefault[i] = false;
88
+          }
85 89
         }
90
+        this.$emit('DefaultImage', index);
86 91
       }
87
-      this.$emit('DefaultImage', index);
88 92
     },
89 93
   },
90 94
 };

+ 29
- 12
src/components/property/propertyList.vue Datei anzeigen

@@ -26,24 +26,30 @@
26 26
             <th>Type</th>
27 27
             <th>Publish</th>
28 28
             <th>Status</th>
29
-            <th>Edit</th>
30
-            <th>Delete</th>
29
+            <th></th>
30
+            <th></th>
31 31
           </tr>
32 32
         </thead>
33 33
         <tbody>
34 34
           <tr v-for="(item, i) in properties" :key="i">
35
-            <td v-if="item.propertyType.usageType === 1">{{item.propertyName}}</td>
36
-            <td v-else>{{ item.shortDescription }}</td>
37
-            <td>{{item.id}}</td>
38
-            <td></td>
35
+            <td>{{ item.name }}</td>
36
+            <td>{{ item.id }}</td>
37
+            <td v-html="item.size" />
39 38
             <td>{{ item.price }}</td>
40
-            <td>{{ item.propertyType.description }}</td>
39
+            <td>{{ item.type }}</td>
41 40
             <td>{{ item.publish }}</td>
42
-            <td>Publish</td>
41
+            <td>{{ item.status }}</td>
43 42
             <td>
44
-              <router-link :to="`/property/${item.id}`">Edit</router-link>
43
+              <button
44
+                type="button"
45
+                @click="Edit(item)"
46
+                class="btn btn-b-n"
47
+                style="width: 85px; height:40px;"
48
+              >Edit</button>
49
+            </td>
50
+            <td>
51
+              <button type="button" class="btn btn-b-n" style="width: 85px; height:40px;">Delete</button>
45 52
             </td>
46
-            <td>Delete</td>
47 53
           </tr>
48 54
         </tbody>
49 55
       </table>
@@ -64,17 +70,28 @@ export default {
64 70
   },
65 71
   methods: {
66 72
     ...mapActions('propertyList', ['getProperties']),
73
+    Edit(item) {
74
+      const salesType = item.isSale ? 'Sale' : 'Rental';
75
+      this.$router.push({
76
+        path: `/property/${this.propertyType}/${salesType}`,
77
+        query: { id: item.id },
78
+      });
79
+    },
67 80
   },
68 81
   mounted() {
69 82
     this.propertyType = this.$route.params.propertyType;
70 83
     this.user = this.$route.params.user;
71 84
 
85
+    if (this.user === 'MyListings') {
86
+      this.user = 'GeorgeW';
87
+    }
88
+
72 89
     this.getProperties(
73 90
       Object.assign(
74 91
         {},
75 92
         {
76
-          propertyType: this.$route.params.propertyType,
77
-          user: this.$route.params.user,
93
+          propertyType: this.propertyType,
94
+          user: this.user,
78 95
         },
79 96
       ),
80 97
     );

+ 2
- 1
src/components/property/propertyPage.vue Datei anzeigen

@@ -36,7 +36,7 @@
36 36
                     </div>
37 37
                   </div>
38 38
                 </div>
39
-                <div class="property-description" v-html="property ? property.description : ''" />
39
+                <div class="property-description" v-html="property.description" />
40 40
                 <div v-for="display in property.displayData" :key="display.id">
41 41
                   <div class="row section-t3">
42 42
                     <div class="col-sm-12">
@@ -63,6 +63,7 @@
63 63
                     </div>
64 64
                     <div class="card-title-c align-self-center">
65 65
                       <h5 class="title-c">{{ formatPrice(property.price) }}</h5>
66
+                      <h6 v-if="property.pricePer">Per {{property.pricePer}}</h6>
66 67
                     </div>
67 68
                   </div>
68 69
                 </div>

+ 0
- 6
src/components/property/propertyUserField.vue Datei anzeigen

@@ -40,7 +40,6 @@ export default {
40 40
   name: 'UserDefinedField',
41 41
   props: {
42 42
     fields: { type: Array, default: () => [] },
43
-    SetFieldValue: Function,
44 43
   },
45 44
   data() {
46 45
     return {
@@ -56,10 +55,5 @@ export default {
56 55
       this.$emit('UpdateUserDefinedFields', item);
57 56
     },
58 57
   },
59
-  // mounted() {
60
-  //   for (let i = 0; i < this.fields.length; i++) {
61
-  //     console.log(`${this.fields[i].name  } ${  this.fields[i].value}`);
62
-  //   }
63
-  // },
64 58
 };
65 59
 </script>

+ 53
- 26
src/components/property/propertyeditPage.vue Datei anzeigen

@@ -170,11 +170,11 @@
170 170
                   class="form-control"
171 171
                   name="propertyType"
172 172
                   id="propertyType"
173
-                  v-model="property.per"
173
+                  v-model="property.pricePer"
174 174
                 >
175 175
                   <option value>Please select</option>
176
-                  <option value="month">Month</option>
177
-                  <option value="day">Day</option>
176
+                  <option value="Month">Month</option>
177
+                  <option value="Day">Day</option>
178 178
                 </select>
179 179
               </div>
180 180
             </div>
@@ -196,9 +196,10 @@
196 196
               v-if="propertyType === 'Residential' & propertyOverviewFields.length > 0"
197 197
               :fields="propertyOverviewFields[0].fields"
198 198
               @UpdateUserDefinedFields="UpdateUserDefinedFields"
199
+              :id="1"
199 200
             ></UserField>
200 201
             <div class="form-group row" />
201
-            <div v-for="item in propertyFields" :key="item.id">
202
+            <div v-for="(item, i) in propertyFields" :key="item.id">
202 203
               <div class="row">
203 204
                 <div class="col-sm-12">
204 205
                   <div class="title-box-d">
@@ -208,7 +209,7 @@
208 209
               </div>
209 210
               <UserField
210 211
                 :fields="item.fields"
211
-                :id="item.id"
212
+                :id="item.name"
212 213
                 @UpdateUserDefinedFields="UpdateUserDefinedFields"
213 214
               />
214 215
             </div>
@@ -220,17 +221,19 @@
220 221
                 </div>
221 222
               </div>
222 223
             </div>
223
-            <ImageLoad
224
-              :loadedImages="loadedImages"
225
-              :savedImages="propertyImages"
226
-              @DefaultImage="UpdateDefaultImage"
227
-            />
224
+            <ImageLoad :loadedImages="loadedImages" :savedImages="propertyImages" />
228 225
             <button
226
+              v-if="!wait"
229 227
               type="button"
230 228
               @click="SubmitData()"
231 229
               class="btn btn-b-n"
232 230
               style="width: 85px; height:40px;"
233
-            >Save</button>
231
+            >
232
+              <!-- <span class="spinner-border" role="status" aria-hidden="true"></span>
233
+              <span class="sr-only">Loading...</span>-->
234
+              Save
235
+            </button>
236
+            <label v-if="wait">Please wait...</label>
234 237
           </form>
235 238
         </div>
236 239
       </div>
@@ -260,6 +263,7 @@ export default {
260 263
       images: [],
261 264
       propertyFieldValues: [],
262 265
       defaultImage: 0,
266
+      wait: false,
263 267
     };
264 268
   },
265 269
   methods: {
@@ -276,8 +280,10 @@ export default {
276 280
       'getPropertyEditDisplay',
277 281
       'getPropertySavedOverviewFields',
278 282
       'getPropertySavedFields',
283
+      'getSavedPropertyData',
279 284
     ]),
280 285
     SubmitData() {
286
+      this.wait = true;
281 287
       for (let i = 0; i < this.images.length; i++) {
282 288
         let setAsDefault = false;
283 289
         if (i === this.defaultImage) {
@@ -288,13 +294,17 @@ export default {
288 294
           isDefault: setAsDefault,
289 295
         });
290 296
       }
297
+      this.property.createdBy = 'GeorgeW';
291 298
 
292 299
       this.saveProperty(this.property);
293 300
 
294
-      this.$router.push({
295
-        path: '/property/search',
296
-        query: { type: this.salesType, propertyType: this.propertyType },
297
-      });
301
+      setTimeout(
302
+        () => this.$router.push({
303
+            path: '/property/search',
304
+            query: { type: this.salesType, propertyType: this.propertyType },
305
+          }),
306
+        3000,
307
+      );
298 308
     },
299 309
     ProvinceSelected(item) {
300 310
       if (item.target.options.selectedIndex > 0) {
@@ -337,10 +347,34 @@ export default {
337 347
     },
338 348
   },
339 349
   mounted() {
350
+    this.wait = false;
340 351
     this.clearProperty();
341 352
     this.clearPropertyImages();
342 353
     this.images = [];
343 354
     this.defaultImage = 0;
355
+
356
+    if (this.propertyOverviewFields.length > 0) {
357
+      this.propertyOverviewFields = [];
358
+    }
359
+    if (this.propertyFields.length > 0) {
360
+      this.propertyFields = [];
361
+    }
362
+
363
+    this.propertyType = this.$route.params.propType;
364
+    this.salesType = this.$route.params.saleType;
365
+
366
+    this.getPropertyTypes(this.$route.params.propType);
367
+
368
+    this.getProvince();
369
+    if (this.$route.query.id) {
370
+      // this.getCities(Object.assign({}, { province: this.selectedProvince }));
371
+      this.getSavedPropertyData(
372
+        Object.assign({}, { id: this.$route.query.id, type: this.propertyType }),
373
+      );
374
+    } else {
375
+      this.getPropertyOverviewFields();
376
+      this.getPropertyFields(this.$route.params.propType);
377
+    }
344 378
     // if (this.$route.params.id) {
345 379
     //   this.getPropertyEditDisplay(4); // (this.$route.params.id);
346 380
     //   this.propertyType = 'Residential'; // this.propertyEditDisplay.propertyType;
@@ -361,13 +395,7 @@ export default {
361 395
 
362 396
     //   this.getProperty(this.$route.params.id);
363 397
     // } else {
364
-    this.propertyType = this.$route.params.propType;
365
-    this.salesType = this.$route.params.saleType;
366 398
 
367
-    this.getProvince();
368
-    this.getPropertyTypes(this.$route.params.propType);
369
-    this.getPropertyOverviewFields();
370
-    this.getPropertyFields(this.$route.params.propType);
371 399
     // }
372 400
   },
373 401
   computed: {
@@ -378,17 +406,16 @@ export default {
378 406
       'propertyFields',
379 407
       'property',
380 408
       'propertyImages',
381
-      'propertyEditDisplay',
382 409
     ]),
383 410
     SalesTypeChanged() {
384 411
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
385 412
       this.propertyType = this.$route.params.propType;
386 413
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
387 414
       this.salesType = this.$route.params.saleType;
388
-
389
-      this.getPropertyTypes(this.$route.params.propType);
390
-
391
-      this.getPropertyFields(this.$route.params.propType);
415
+      if (!this.$route.query.id) {
416
+        this.getPropertyTypes(this.$route.params.propType);
417
+        this.getPropertyFields(this.$route.params.propType);
418
+      }
392 419
 
393 420
       return this.propertyType;
394 421
     },

+ 2
- 2
src/components/shared/navBar.vue Datei anzeigen

@@ -96,7 +96,7 @@
96 96
               >To Sell</div>
97 97
               <div
98 98
                 class="dropdown-item cursor-pointer"
99
-                @click="routerGoTo('/property/list/Residential/GeorgeW')"
99
+                @click="routerGoTo('/property/list/Residential/MyListings')"
100 100
               >My Residential Properties</div>
101 101
               <div
102 102
                 class="dropdown-item cursor-pointer"
@@ -129,7 +129,7 @@
129 129
               >To Sell</a>
130 130
               <a
131 131
                 class="dropdown-item cursor-pointer"
132
-                @click="routerGoTo('/property/list/Commercial/GeorgeW')"
132
+                @click="routerGoTo('/property/list/Commercial/MyListings')"
133 133
               >My Commercial Properties</a>
134 134
               <a
135 135
                 class="dropdown-item cursor-pointer"

+ 1
- 1
src/router/index.js Datei anzeigen

@@ -106,7 +106,7 @@ export default new Router({
106 106
       component: PropertyEdit,
107 107
     },
108 108
     {
109
-      path: '/property/:id',
109
+      path: '/property/edit/:id/:propType/:saleType',
110 110
       name: 'PropertyEdit',
111 111
       component: PropertyEdit,
112 112
     },

+ 36
- 64
src/store/modules/property/property.js Datei anzeigen

@@ -21,25 +21,6 @@ export default {
21 21
       cityId: 0,
22 22
       provinceId: 0,
23 23
       published: false,
24
-      propertyType: {
25
-        description: '',
26
-        usageType: 0,
27
-        id: 2,
28
-      },
29
-      province: {
30
-        description: '',
31
-        code: '',
32
-        id: 0,
33
-      },
34
-      city: {
35
-        provinceId: 0,
36
-        description: '',
37
-        code: '',
38
-      },
39
-      suburb: {
40
-        cityId: 0,
41
-        description: '',
42
-      },
43 24
       propertyUserFields: [],
44 25
       propertyImages: [],
45 26
       id: 0,
@@ -52,10 +33,6 @@ export default {
52 33
     propertyFields: [],
53 34
     properties: [],
54 35
     latestProperties: [],
55
-    propertyEditDisplay: {
56
-      propertyType: '',
57
-      saleType: '',
58
-    },
59 36
   },
60 37
   mutations: {
61 38
     setProperty(state, property) {
@@ -107,25 +84,6 @@ export default {
107 84
         cityId: 0,
108 85
         provinceId: 0,
109 86
         published: false,
110
-        propertyType: {
111
-          description: '',
112
-          usageType: 0,
113
-          id: 2,
114
-        },
115
-        province: {
116
-          description: '',
117
-          code: '',
118
-          id: 0,
119
-        },
120
-        city: {
121
-          provinceId: 0,
122
-          description: '',
123
-          code: '',
124
-        },
125
-        suburb: {
126
-          cityId: 0,
127
-          description: '',
128
-        },
129 87
         propertyUserFields: [],
130 88
         propertyImages: [],
131 89
         id: 0,
@@ -134,91 +92,87 @@ export default {
134 92
     clearPropertyImages(state) {
135 93
       state.propertyImages = [];
136 94
     },
137
-    setPropertyEditDisplay(state, item) {
138
-      state.propertyEditDisplay = item;
95
+    setProperties(state, properties) {
96
+      state.properties = properties;
139 97
     },
140 98
   },
141 99
   getters: {},
142 100
   actions: {
143 101
     getProperty({ commit }, id) {
144 102
       axios
145
-        .get(`http://192.168.6.188:5000/Property/Property/${id}`)
103
+        .get(`/api/Property/${id}`)
146 104
         .then(result => commit('setProperty', result.data))
147 105
         .catch(console.error);
148 106
     },
149 107
     getPropertyImages({ commit }, id) {
150 108
       axios
151
-        .get(`http://192.168.6.188:5000/property/PropertyImage/getpropertyimages/${id}`)
109
+        .get(`/api/PropertyImage/getPropertyImages/${id}`)
152 110
         .then(result => commit('setPropertyImages', result.data))
153 111
         .catch(console.error);
154 112
     },
155 113
     getPropertyTypes({ commit }, propertyType) {
156 114
       axios
157
-        .get(`http://192.168.6.188:5000/Property/PropertyType/type/${propertyType}`)
115
+        .get(`/api/PropertyType/type/${propertyType}`)
158 116
         .then(result => commit('setPropertyTypes', result.data))
159 117
         .catch(console.error);
160 118
     },
161 119
     getPropertyTypesRes({ commit }) {
162 120
       axios
163
-        .get('http://192.168.6.188:5000/Property/PropertyType/type/Residential')
121
+        .get('/api/PropertyType/type/Residential')
164 122
         .then(result => commit('setPropertyTypesRes', result.data))
165 123
         .catch(console.error);
166 124
     },
167 125
     getPropertyTypesCom({ commit }) {
168 126
       axios
169
-        .get('http://192.168.6.188:5000/Property/PropertyType/type/Commercial')
127
+        .get('/api/PropertyType/type/Commercial')
170 128
         .then(result => commit('setPropertyTypesCom', result.data))
171 129
         .catch(console.error);
172 130
     },
173 131
     getPropertyOverviewFields({ commit }) {
174 132
       axios
175
-        .get('http://192.168.6.188:5000/Property/PropertyFields/Property Overview')
133
+        .get('/api/PropertyFields/Property Overview')
176 134
         .then(response => commit('setPropertyOverviewFields', response.data));
177 135
     },
178 136
     getPropertyFields({ commit }, propertyType) {
179 137
       axios
180
-        .get(`http://192.168.6.188:5000/property/propertyfields/Propertytype/${propertyType}`)
138
+        .get(`/api/propertyFields/PropertyType/${propertyType}`)
181 139
         .then(response => commit('setPropertyFields', response.data));
182 140
     },
183 141
     getPropertySavedOverviewFields({ commit }, id) {
184 142
       axios
185
-        .get(
186
-          `http://192.168.6.188:5000/Property/PropertyFields/GetSavedValues/Residential/Property Overview/${id}`,
187
-        )
143
+        .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${id}`)
188 144
         .then(response => commit('setPropertyOverviewFields', response.data))
189 145
         .catch(console.error);
190 146
     },
191 147
     getPropertySavedFields({ commit }, item) {
192 148
       axios
193
-        .get(
194
-          `http://192.168.6.188:5000/Property/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`,
195
-        )
149
+        .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
196 150
         .then(response => commit('setPropertyFields', response.data))
197 151
         .catch(console.error);
198 152
     },
199 153
     saveProperty({ commit }, item) {
200 154
       axios
201
-        .post('http://192.168.6.188:5000/Property/Property', item)
155
+        .post('/api/Property', item)
202 156
         .then(result => commit('updateCurrentProperty', result.data))
203 157
         .catch(console.error);
204 158
     },
205 159
     searchPropertiesParams({ commit }, item) {
206 160
       axios
207 161
         .get(
208
-          `http://192.168.6.188:5000/Property/Property/Search/${item.type}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.propType}`,
162
+          `/api/property/search/${item.type}/${item.propertyType}/${item.province}/${item.city}/${item.suburb}/${item.propType}`,
209 163
         )
210 164
         .then(response => commit('updateSearch', response.data))
211 165
         .catch(console.error);
212 166
     },
213 167
     searchPropertiesKeyword({ commit }, item) {
214 168
       axios
215
-        .get(`http://192.168.6.188:5000/Property/Property/Search/${item.keyword}`)
169
+        .get(`/api/Property/Search/${item.keyword}`)
216 170
         .then(response => commit('updateSearch', response.data))
217 171
         .catch(console.error);
218 172
     },
219 173
     searchLatestProperties({ commit }) {
220 174
       axios
221
-        .get('http://192.168.6.188:5000/property/property/latestProperties')
175
+        .get('/api/property/latestProperties')
222 176
         .then(response => commit('setLatestProperties', response.data))
223 177
         .catch(console.error);
224 178
     },
@@ -228,10 +182,28 @@ export default {
228 182
     clearPropertyImages({ commit }) {
229 183
       commit('clearPropertyImages');
230 184
     },
231
-    getPropertyEditDisplay({ commit }, id) {
185
+    getSavedPropertyData({ commit }, item) {
186
+      commit('clearProperty');
187
+      commit('clearPropertyImages');
188
+
189
+      axios
190
+        .get(`/api/Property/${item.id}`)
191
+        .then(result => commit('setProperty', result.data))
192
+        .catch(console.error);
193
+
194
+      axios
195
+        .get(`/api/PropertyImage/getPropertyImages/${item.id}`)
196
+        .then(result => commit('setPropertyImages', result.data))
197
+        .catch(console.error);
198
+
232 199
       axios
233
-        .get(`http://192.168.6.188:5000/Property/Property/GetEditDisplay/${id}`)
234
-        .then(response => commit('setPropertyEditDisplay', response.data))
200
+        .get(`/api/PropertyFields/GetSavedValues/Residential/Property Overview/${item.id}`)
201
+        .then(response => commit('setPropertyOverviewFields', response.data))
202
+        .catch(console.error);
203
+
204
+      axios
205
+        .get(`/api/PropertyFields/GetSavedValues/${item.type}/All/${item.id}`)
206
+        .then(response => commit('setPropertyFields', response.data))
235 207
         .catch(console.error);
236 208
     },
237 209
   },

+ 10
- 10
src/store/modules/property/propertyAdmin.js Datei anzeigen

@@ -79,61 +79,61 @@ export default {
79 79
   actions: {
80 80
     getUserDefinedGroups({ commit }) {
81 81
       axios
82
-        .get('http://192.168.6.188:5000/Property/UserDefinedGroup')
82
+        .get('/api/UserDefinedGroup')
83 83
         .then(result => commit('setUserDefinedGroups', result.data))
84 84
         .catch(console.error);
85 85
     },
86 86
     getUserDefinedGroup({ commit }, id) {
87 87
       axios
88
-        .get(`http://192.168.6.188:5000/Property/UserDefinedGroup/${id}`)
88
+        .get(`/api/UserDefinedGroup/${id}`)
89 89
         .then(result => commit('setUserDefinedGroup', result.data))
90 90
         .catch(console.error);
91 91
     },
92 92
     getUserFields({ commit }, groupId) {
93 93
       axios
94
-        .get(`http://192.168.6.188:5000/Property/UserDefinedField/group/${groupId}`)
94
+        .get(`/api/UserDefinedField/group/${groupId}`)
95 95
         .then(result => commit('setUserFields', result.data))
96 96
         .catch(console.error);
97 97
     },
98 98
     getUserField({ commit }, id) {
99 99
       axios
100
-        .get(`http://192.168.6.188:5000/Property/UserDefinedField/${id}`)
100
+        .get(`/api/UserDefinedField/${id}`)
101 101
         .then(result => commit('setUserField', result.data))
102 102
         .catch(console.error);
103 103
     },
104 104
     saveUserDefinedGroup({ commit }, item) {
105 105
       axios
106
-        .post('http://192.168.6.188:5000/Property/UserDefinedGroup', item)
106
+        .post('/api/UserDefinedGroup', item)
107 107
         .then(response => commit('addUserDefinedGroups', response.data))
108 108
         .catch(console.error);
109 109
     },
110 110
     updateUserDefinedGroup({ commit }, item) {
111 111
       axios
112
-        .put('http://192.168.6.188:5000/Property/UserDefinedGroup', item)
112
+        .put('/api/UserDefinedGroup', item)
113 113
         .then(response => commit('updateUserDefinedGroups', response.data))
114 114
         .catch(console.error);
115 115
     },
116 116
     saveUserField({ commit }, item) {
117 117
       axios
118
-        .post('http://192.168.6.188:5000/Property/UserDefinedField', item)
118
+        .post('/api/UserDefinedField', item)
119 119
         .then(response => commit('addUserField', response.data))
120 120
         .catch(console.error);
121 121
     },
122 122
     updateUserField({ commit }, item) {
123 123
       axios
124
-        .put('http://192.168.6.188:5000/Property/UserDefinedField', item)
124
+        .put('/api/UserDefinedField', item)
125 125
         .then(response => commit('updateUserFields', response.data))
126 126
         .catch(console.error);
127 127
     },
128 128
     deleteUserDefinedGroup({ commit }, id) {
129 129
       axios
130
-        .delete(`http://192.168.6.188:5000/Property/UserDefinedGroup/${id}`)
130
+        .delete(`/api/UserDefinedGroup/${id}`)
131 131
         .then(result => commit('removeUserDefinedGroup', id))
132 132
         .catch(console.error);
133 133
     },
134 134
     deleteUserField({ commit }, id) {
135 135
       axios
136
-        .delete(`http://192.168.6.188:5000/Property/UserDefinedField/${id}`)
136
+        .delete(`/api/UserDefinedField/${id}`)
137 137
         .then(result => commit('removeUserField', id))
138 138
         .catch(console.error);
139 139
     },

+ 1
- 1
src/store/modules/property/propertyLists.js Datei anzeigen

@@ -14,7 +14,7 @@ export default {
14 14
   actions: {
15 15
     getProperties({ commit }, item) {
16 16
       axios
17
-        .get(`http://192.168.6.188:5000/Property/property/${item.propertyType}/${item.user}`)
17
+        .get(`/api/property/${item.propertyType}/${item.user}`)
18 18
         .then(result => commit('setProperties', result.data))
19 19
         .catch(console.error);
20 20
     },

+ 5
- 5
src/store/modules/property/propertyTypes.js Datei anzeigen

@@ -37,25 +37,25 @@ export default {
37 37
   actions: {
38 38
     getPropertyTypes({ commit }) {
39 39
       axios
40
-        .get('http://192.168.6.188:5000/Property/PropertyType')
40
+        .get('/api/PropertyType')
41 41
         .then(result => commit('setPropertyTypes', result.data))
42 42
         .catch(console.error);
43 43
     },
44 44
     getPropertyType({ commit }, id) {
45 45
       axios
46
-        .get(`http://192.168.6.188:5000/Property/PropertyType/${id}`)
46
+        .get(`/api/PropertyType/${id}`)
47 47
         .then(result => commit('setPropertyType', result.data))
48 48
         .catch(console.error);
49 49
     },
50 50
     savePropertyType({ commit }, item) {
51 51
       axios
52
-        .post('http://192.168.6.188:5000/Property/PropertyType', item)
52
+        .post('/api/PropertyType', item)
53 53
         .then(result => commit('addToPropertyTypes', result.data))
54 54
         .catch(console.error);
55 55
     },
56 56
     updatePropertyType({ commit }, item) {
57 57
       axios
58
-        .put('http://192.168.6.188:5000/Property/PropertyType', item)
58
+        .put('/api/PropertyType', item)
59 59
         .then(result => commit('updatePropertyTypes', item))
60 60
         .catch(console.error);
61 61
     },
@@ -64,7 +64,7 @@ export default {
64 64
     },
65 65
     deletePropertyType({ commit }, id) {
66 66
       axios
67
-        .delete(`http://192.168.6.188:5000/Property/PropertyType/${id}`)
67
+        .delete(`/api/PropertyType/${id}`)
68 68
         .then(result => commit('removePropertyType', id))
69 69
         .catch(console.error);
70 70
     },

+ 3
- 3
src/store/modules/searchTab.js Datei anzeigen

@@ -22,18 +22,18 @@ export default {
22 22
   actions: {
23 23
     getProvince({ commit }) {
24 24
       axios
25
-        .get('http://192.168.6.188:5000/region/province')
25
+        .get('/api/province')
26 26
         .then(result => commit('setProvince', result.data))
27 27
         .catch(console.error);
28 28
     },
29 29
     getCities({ commit }, item) {
30 30
       axios
31
-        .get(`http://192.168.6.188:5000/region/city/getby/${item.province}`)
31
+        .get(`/api/city/getBy/${item.province}`)
32 32
         .then(result => commit('setCities', result.data));
33 33
     },
34 34
     getSuburbs({ commit }, item) {
35 35
       axios
36
-        .get(`http://192.168.6.188:5000/region/Suburb/${item.province}/${item.city}`)
36
+        .get(`/api/Suburb/${item.province}/${item.city}`)
37 37
         .then(result => commit('setSuburbs', result.data));
38 38
     },
39 39
   },

Laden…
Abbrechen
Speichern