Преглед изворни кода

Use Id on Resort pages - add validation

master
Brian Conway пре 2 година
родитељ
комит
23efaf205c

+ 339
- 23
package-lock.json Прегледај датотеку

@@ -12,6 +12,8 @@
12 12
         "animate.css": "^3.7.2",
13 13
         "aos": "^3.0.0-beta.6",
14 14
         "axios": "^0.24.0",
15
+        "bootstrap": "^5.1.3",
16
+        "bootstrap-vue": "^2.22.0",
15 17
         "core-js": "^2.6.12",
16 18
         "crypto-js": "^4.0.0",
17 19
         "datatables.net": "^1.11.3",
@@ -1193,6 +1195,87 @@
1193 1195
         "node": ">= 6"
1194 1196
       }
1195 1197
     },
1198
+    "node_modules/@nuxt/opencollective": {
1199
+      "version": "0.3.2",
1200
+      "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.3.2.tgz",
1201
+      "integrity": "sha512-XG7rUdXG9fcafu9KTDIYjJSkRO38EwjlKYIb5TQ/0WDbiTUTtUtgncMscKOYzfsY86kGs05pAuMOR+3Fi0aN3A==",
1202
+      "dependencies": {
1203
+        "chalk": "^4.1.0",
1204
+        "consola": "^2.15.0",
1205
+        "node-fetch": "^2.6.1"
1206
+      },
1207
+      "bin": {
1208
+        "opencollective": "bin/opencollective.js"
1209
+      },
1210
+      "engines": {
1211
+        "node": ">=8.0.0",
1212
+        "npm": ">=5.0.0"
1213
+      }
1214
+    },
1215
+    "node_modules/@nuxt/opencollective/node_modules/ansi-styles": {
1216
+      "version": "4.3.0",
1217
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
1218
+      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
1219
+      "dependencies": {
1220
+        "color-convert": "^2.0.1"
1221
+      },
1222
+      "engines": {
1223
+        "node": ">=8"
1224
+      },
1225
+      "funding": {
1226
+        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
1227
+      }
1228
+    },
1229
+    "node_modules/@nuxt/opencollective/node_modules/chalk": {
1230
+      "version": "4.1.2",
1231
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
1232
+      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
1233
+      "dependencies": {
1234
+        "ansi-styles": "^4.1.0",
1235
+        "supports-color": "^7.1.0"
1236
+      },
1237
+      "engines": {
1238
+        "node": ">=10"
1239
+      },
1240
+      "funding": {
1241
+        "url": "https://github.com/chalk/chalk?sponsor=1"
1242
+      }
1243
+    },
1244
+    "node_modules/@nuxt/opencollective/node_modules/color-convert": {
1245
+      "version": "2.0.1",
1246
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
1247
+      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
1248
+      "dependencies": {
1249
+        "color-name": "~1.1.4"
1250
+      },
1251
+      "engines": {
1252
+        "node": ">=7.0.0"
1253
+      }
1254
+    },
1255
+    "node_modules/@nuxt/opencollective/node_modules/color-name": {
1256
+      "version": "1.1.4",
1257
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
1258
+      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
1259
+    },
1260
+    "node_modules/@nuxt/opencollective/node_modules/has-flag": {
1261
+      "version": "4.0.0",
1262
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
1263
+      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
1264
+      "engines": {
1265
+        "node": ">=8"
1266
+      }
1267
+    },
1268
+    "node_modules/@nuxt/opencollective/node_modules/supports-color": {
1269
+      "version": "7.2.0",
1270
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
1271
+      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
1272
+      "dependencies": {
1273
+        "has-flag": "^4.0.0"
1274
+      },
1275
+      "engines": {
1276
+        "node": ">=8"
1277
+      }
1278
+    },
1196 1279
     "node_modules/@nuxtjs/axios": {
1197 1280
       "version": "5.13.1",
1198 1281
       "resolved": "https://registry.npmjs.org/@nuxtjs/axios/-/axios-5.13.1.tgz",
@@ -1321,6 +1404,16 @@
1321 1404
         "node": ">=8.0"
1322 1405
       }
1323 1406
     },
1407
+    "node_modules/@popperjs/core": {
1408
+      "version": "2.11.5",
1409
+      "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz",
1410
+      "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==",
1411
+      "peer": true,
1412
+      "funding": {
1413
+        "type": "opencollective",
1414
+        "url": "https://opencollective.com/popperjs"
1415
+      }
1416
+    },
1324 1417
     "node_modules/@soda/friendly-errors-webpack-plugin": {
1325 1418
       "version": "1.7.1",
1326 1419
       "resolved": "https://registry.npmjs.org/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz",
@@ -2896,6 +2989,44 @@
2896 2989
       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
2897 2990
       "dev": true
2898 2991
     },
2992
+    "node_modules/bootstrap": {
2993
+      "version": "5.1.3",
2994
+      "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
2995
+      "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
2996
+      "funding": {
2997
+        "type": "opencollective",
2998
+        "url": "https://opencollective.com/bootstrap"
2999
+      },
3000
+      "peerDependencies": {
3001
+        "@popperjs/core": "^2.10.2"
3002
+      }
3003
+    },
3004
+    "node_modules/bootstrap-vue": {
3005
+      "version": "2.22.0",
3006
+      "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.22.0.tgz",
3007
+      "integrity": "sha512-denjR/ae0K7Jrcqud3TrZWw0p/crtyigeGUNunWQ4t+KFi+7rzJ6j6lx1W5/gpUtSSUgNbWrXcHH4lIWXzXOOQ==",
3008
+      "hasInstallScript": true,
3009
+      "dependencies": {
3010
+        "@nuxt/opencollective": "^0.3.2",
3011
+        "bootstrap": "^4.6.1",
3012
+        "popper.js": "^1.16.1",
3013
+        "portal-vue": "^2.1.7",
3014
+        "vue-functional-data-merge": "^3.1.0"
3015
+      }
3016
+    },
3017
+    "node_modules/bootstrap-vue/node_modules/bootstrap": {
3018
+      "version": "4.6.1",
3019
+      "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.1.tgz",
3020
+      "integrity": "sha512-0dj+VgI9Ecom+rvvpNZ4MUZJz8dcX7WCX+eTID9+/8HgOkv3dsRzi8BGeZJCQU6flWQVYxwTQnEZFrmJSEO7og==",
3021
+      "funding": {
3022
+        "type": "opencollective",
3023
+        "url": "https://opencollective.com/bootstrap"
3024
+      },
3025
+      "peerDependencies": {
3026
+        "jquery": "1.9.1 - 3",
3027
+        "popper.js": "^1.16.1"
3028
+      }
3029
+    },
2899 3030
     "node_modules/brace-expansion": {
2900 3031
       "version": "1.1.11",
2901 3032
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -3029,16 +3160,6 @@
3029 3160
         "url": "https://opencollective.com/browserslist"
3030 3161
       }
3031 3162
     },
3032
-    "node_modules/browserslist/node_modules/caniuse-lite": {
3033
-      "version": "1.0.30001274",
3034
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz",
3035
-      "integrity": "sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew==",
3036
-      "dev": true,
3037
-      "funding": {
3038
-        "type": "opencollective",
3039
-        "url": "https://opencollective.com/browserslist"
3040
-      }
3041
-    },
3042 3163
     "node_modules/browserslist/node_modules/electron-to-chromium": {
3043 3164
       "version": "1.3.886",
3044 3165
       "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.886.tgz",
@@ -3263,10 +3384,20 @@
3263 3384
       }
3264 3385
     },
3265 3386
     "node_modules/caniuse-lite": {
3266
-      "version": "1.0.30001022",
3267
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001022.tgz",
3268
-      "integrity": "sha512-FjwPPtt/I07KyLPkBQ0g7/XuZg6oUkYBVnPHNj3VHJbOjmmJ/GdSo/GUY6MwINEQvjhP6WZVbX8Tvms8xh0D5A==",
3269
-      "dev": true
3387
+      "version": "1.0.30001332",
3388
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001332.tgz",
3389
+      "integrity": "sha512-10T30NYOEQtN6C11YGg411yebhvpnC6Z102+B95eAsN0oB6KUs01ivE8u+G6FMIRtIrVlYXhL+LUwQ3/hXwDWw==",
3390
+      "dev": true,
3391
+      "funding": [
3392
+        {
3393
+          "type": "opencollective",
3394
+          "url": "https://opencollective.com/browserslist"
3395
+        },
3396
+        {
3397
+          "type": "tidelift",
3398
+          "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
3399
+        }
3400
+      ]
3270 3401
     },
3271 3402
     "node_modules/canvg": {
3272 3403
       "version": "3.0.9",
@@ -10029,6 +10160,25 @@
10029 10160
         "lower-case": "^1.1.1"
10030 10161
       }
10031 10162
     },
10163
+    "node_modules/node-fetch": {
10164
+      "version": "2.6.7",
10165
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
10166
+      "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
10167
+      "dependencies": {
10168
+        "whatwg-url": "^5.0.0"
10169
+      },
10170
+      "engines": {
10171
+        "node": "4.x || >=6.0.0"
10172
+      },
10173
+      "peerDependencies": {
10174
+        "encoding": "^0.1.0"
10175
+      },
10176
+      "peerDependenciesMeta": {
10177
+        "encoding": {
10178
+          "optional": true
10179
+        }
10180
+      }
10181
+    },
10032 10182
     "node_modules/node-gyp": {
10033 10183
       "version": "3.8.0",
10034 10184
       "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz",
@@ -11024,6 +11174,24 @@
11024 11174
         "node": ">=4"
11025 11175
       }
11026 11176
     },
11177
+    "node_modules/popper.js": {
11178
+      "version": "1.16.1",
11179
+      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
11180
+      "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==",
11181
+      "deprecated": "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1",
11182
+      "funding": {
11183
+        "type": "opencollective",
11184
+        "url": "https://opencollective.com/popperjs"
11185
+      }
11186
+    },
11187
+    "node_modules/portal-vue": {
11188
+      "version": "2.1.7",
11189
+      "resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz",
11190
+      "integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==",
11191
+      "peerDependencies": {
11192
+        "vue": "^2.5.18"
11193
+      }
11194
+    },
11027 11195
     "node_modules/portfinder": {
11028 11196
       "version": "1.0.25",
11029 11197
       "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz",
@@ -14173,6 +14341,11 @@
14173 14341
       "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
14174 14342
       "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
14175 14343
     },
14344
+    "node_modules/tr46": {
14345
+      "version": "0.0.3",
14346
+      "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
14347
+      "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
14348
+    },
14176 14349
     "node_modules/trim-newlines": {
14177 14350
       "version": "1.0.0",
14178 14351
       "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
@@ -14758,6 +14931,11 @@
14758 14931
       "resolved": "https://registry.npmjs.org/vue-float-label/-/vue-float-label-1.6.1.tgz",
14759 14932
       "integrity": "sha1-I1HnGyXyGwbUNWOwRveNlRKgjGY="
14760 14933
     },
14934
+    "node_modules/vue-functional-data-merge": {
14935
+      "version": "3.1.0",
14936
+      "resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-3.1.0.tgz",
14937
+      "integrity": "sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA=="
14938
+    },
14761 14939
     "node_modules/vue-head": {
14762 14940
       "version": "2.2.0",
14763 14941
       "resolved": "https://registry.npmjs.org/vue-head/-/vue-head-2.2.0.tgz",
@@ -14984,6 +15162,11 @@
14984 15162
         "defaults": "^1.0.3"
14985 15163
       }
14986 15164
     },
15165
+    "node_modules/webidl-conversions": {
15166
+      "version": "3.0.1",
15167
+      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
15168
+      "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
15169
+    },
14987 15170
     "node_modules/webpack": {
14988 15171
       "version": "4.46.0",
14989 15172
       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz",
@@ -15886,6 +16069,15 @@
15886 16069
         "node": ">=0.8.0"
15887 16070
       }
15888 16071
     },
16072
+    "node_modules/whatwg-url": {
16073
+      "version": "5.0.0",
16074
+      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
16075
+      "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
16076
+      "dependencies": {
16077
+        "tr46": "~0.0.3",
16078
+        "webidl-conversions": "^3.0.0"
16079
+      }
16080
+    },
15889 16081
     "node_modules/when": {
15890 16082
       "version": "3.6.4",
15891 16083
       "resolved": "https://registry.npmjs.org/when/-/when-3.6.4.tgz",
@@ -17017,6 +17209,61 @@
17017 17209
       "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==",
17018 17210
       "dev": true
17019 17211
     },
17212
+    "@nuxt/opencollective": {
17213
+      "version": "0.3.2",
17214
+      "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.3.2.tgz",
17215
+      "integrity": "sha512-XG7rUdXG9fcafu9KTDIYjJSkRO38EwjlKYIb5TQ/0WDbiTUTtUtgncMscKOYzfsY86kGs05pAuMOR+3Fi0aN3A==",
17216
+      "requires": {
17217
+        "chalk": "^4.1.0",
17218
+        "consola": "^2.15.0",
17219
+        "node-fetch": "^2.6.1"
17220
+      },
17221
+      "dependencies": {
17222
+        "ansi-styles": {
17223
+          "version": "4.3.0",
17224
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
17225
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
17226
+          "requires": {
17227
+            "color-convert": "^2.0.1"
17228
+          }
17229
+        },
17230
+        "chalk": {
17231
+          "version": "4.1.2",
17232
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
17233
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
17234
+          "requires": {
17235
+            "ansi-styles": "^4.1.0",
17236
+            "supports-color": "^7.1.0"
17237
+          }
17238
+        },
17239
+        "color-convert": {
17240
+          "version": "2.0.1",
17241
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
17242
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
17243
+          "requires": {
17244
+            "color-name": "~1.1.4"
17245
+          }
17246
+        },
17247
+        "color-name": {
17248
+          "version": "1.1.4",
17249
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
17250
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
17251
+        },
17252
+        "has-flag": {
17253
+          "version": "4.0.0",
17254
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
17255
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
17256
+        },
17257
+        "supports-color": {
17258
+          "version": "7.2.0",
17259
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
17260
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
17261
+          "requires": {
17262
+            "has-flag": "^4.0.0"
17263
+          }
17264
+        }
17265
+      }
17266
+    },
17020 17267
     "@nuxtjs/axios": {
17021 17268
       "version": "5.13.1",
17022 17269
       "resolved": "https://registry.npmjs.org/@nuxtjs/axios/-/axios-5.13.1.tgz",
@@ -17114,6 +17361,12 @@
17114 17361
         }
17115 17362
       }
17116 17363
     },
17364
+    "@popperjs/core": {
17365
+      "version": "2.11.5",
17366
+      "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz",
17367
+      "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==",
17368
+      "peer": true
17369
+    },
17117 17370
     "@soda/friendly-errors-webpack-plugin": {
17118 17371
       "version": "1.7.1",
17119 17372
       "resolved": "https://registry.npmjs.org/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz",
@@ -18431,6 +18684,32 @@
18431 18684
       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
18432 18685
       "dev": true
18433 18686
     },
18687
+    "bootstrap": {
18688
+      "version": "5.1.3",
18689
+      "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
18690
+      "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
18691
+      "requires": {}
18692
+    },
18693
+    "bootstrap-vue": {
18694
+      "version": "2.22.0",
18695
+      "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.22.0.tgz",
18696
+      "integrity": "sha512-denjR/ae0K7Jrcqud3TrZWw0p/crtyigeGUNunWQ4t+KFi+7rzJ6j6lx1W5/gpUtSSUgNbWrXcHH4lIWXzXOOQ==",
18697
+      "requires": {
18698
+        "@nuxt/opencollective": "^0.3.2",
18699
+        "bootstrap": "^4.6.1",
18700
+        "popper.js": "^1.16.1",
18701
+        "portal-vue": "^2.1.7",
18702
+        "vue-functional-data-merge": "^3.1.0"
18703
+      },
18704
+      "dependencies": {
18705
+        "bootstrap": {
18706
+          "version": "4.6.1",
18707
+          "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.1.tgz",
18708
+          "integrity": "sha512-0dj+VgI9Ecom+rvvpNZ4MUZJz8dcX7WCX+eTID9+/8HgOkv3dsRzi8BGeZJCQU6flWQVYxwTQnEZFrmJSEO7og==",
18709
+          "requires": {}
18710
+        }
18711
+      }
18712
+    },
18434 18713
     "brace-expansion": {
18435 18714
       "version": "1.1.11",
18436 18715
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -18550,12 +18829,6 @@
18550 18829
         "picocolors": "^1.0.0"
18551 18830
       },
18552 18831
       "dependencies": {
18553
-        "caniuse-lite": {
18554
-          "version": "1.0.30001274",
18555
-          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz",
18556
-          "integrity": "sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew==",
18557
-          "dev": true
18558
-        },
18559 18832
         "electron-to-chromium": {
18560 18833
           "version": "1.3.886",
18561 18834
           "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.886.tgz",
@@ -18747,9 +19020,9 @@
18747 19020
       }
18748 19021
     },
18749 19022
     "caniuse-lite": {
18750
-      "version": "1.0.30001022",
18751
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001022.tgz",
18752
-      "integrity": "sha512-FjwPPtt/I07KyLPkBQ0g7/XuZg6oUkYBVnPHNj3VHJbOjmmJ/GdSo/GUY6MwINEQvjhP6WZVbX8Tvms8xh0D5A==",
19023
+      "version": "1.0.30001332",
19024
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001332.tgz",
19025
+      "integrity": "sha512-10T30NYOEQtN6C11YGg411yebhvpnC6Z102+B95eAsN0oB6KUs01ivE8u+G6FMIRtIrVlYXhL+LUwQ3/hXwDWw==",
18753 19026
       "dev": true
18754 19027
     },
18755 19028
     "canvg": {
@@ -24323,6 +24596,14 @@
24323 24596
         "lower-case": "^1.1.1"
24324 24597
       }
24325 24598
     },
24599
+    "node-fetch": {
24600
+      "version": "2.6.7",
24601
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
24602
+      "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
24603
+      "requires": {
24604
+        "whatwg-url": "^5.0.0"
24605
+      }
24606
+    },
24326 24607
     "node-gyp": {
24327 24608
       "version": "3.8.0",
24328 24609
       "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz",
@@ -25109,6 +25390,17 @@
25109 25390
       "dev": true,
25110 25391
       "optional": true
25111 25392
     },
25393
+    "popper.js": {
25394
+      "version": "1.16.1",
25395
+      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
25396
+      "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ=="
25397
+    },
25398
+    "portal-vue": {
25399
+      "version": "2.1.7",
25400
+      "resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz",
25401
+      "integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==",
25402
+      "requires": {}
25403
+    },
25112 25404
     "portfinder": {
25113 25405
       "version": "1.0.25",
25114 25406
       "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz",
@@ -27684,6 +27976,11 @@
27684 27976
         }
27685 27977
       }
27686 27978
     },
27979
+    "tr46": {
27980
+      "version": "0.0.3",
27981
+      "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
27982
+      "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
27983
+    },
27687 27984
     "trim-newlines": {
27688 27985
       "version": "1.0.0",
27689 27986
       "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
@@ -28177,6 +28474,11 @@
28177 28474
       "resolved": "https://registry.npmjs.org/vue-float-label/-/vue-float-label-1.6.1.tgz",
28178 28475
       "integrity": "sha1-I1HnGyXyGwbUNWOwRveNlRKgjGY="
28179 28476
     },
28477
+    "vue-functional-data-merge": {
28478
+      "version": "3.1.0",
28479
+      "resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-3.1.0.tgz",
28480
+      "integrity": "sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA=="
28481
+    },
28180 28482
     "vue-head": {
28181 28483
       "version": "2.2.0",
28182 28484
       "resolved": "https://registry.npmjs.org/vue-head/-/vue-head-2.2.0.tgz",
@@ -28378,6 +28680,11 @@
28378 28680
         "defaults": "^1.0.3"
28379 28681
       }
28380 28682
     },
28683
+    "webidl-conversions": {
28684
+      "version": "3.0.1",
28685
+      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
28686
+      "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
28687
+    },
28381 28688
     "webpack": {
28382 28689
       "version": "4.46.0",
28383 28690
       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz",
@@ -29122,6 +29429,15 @@
29122 29429
       "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
29123 29430
       "dev": true
29124 29431
     },
29432
+    "whatwg-url": {
29433
+      "version": "5.0.0",
29434
+      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
29435
+      "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
29436
+      "requires": {
29437
+        "tr46": "~0.0.3",
29438
+        "webidl-conversions": "^3.0.0"
29439
+      }
29440
+    },
29125 29441
     "when": {
29126 29442
       "version": "3.6.4",
29127 29443
       "resolved": "https://registry.npmjs.org/when/-/when-3.6.4.tgz",

+ 2
- 0
package.json Прегледај датотеку

@@ -13,6 +13,8 @@
13 13
     "animate.css": "^3.7.2",
14 14
     "aos": "^3.0.0-beta.6",
15 15
     "axios": "^0.24.0",
16
+    "bootstrap": "^5.1.3",
17
+    "bootstrap-vue": "^2.22.0",
16 18
     "core-js": "^2.6.12",
17 19
     "crypto-js": "^4.0.0",
18 20
     "datatables.net": "^1.11.3",

+ 2
- 2
src/components/shared/navBar.vue Прегледај датотеку

@@ -56,7 +56,7 @@
56 56
                       Commercial
57 57
                     </a>
58 58
                     <ul style="margin-top:-10px; text-align:left" :class="commercialClass">
59
-                      <li>                     
59
+                      <li>
60 60
                       </li>
61 61
                       <hr />
62 62
                       <li>
@@ -341,7 +341,7 @@
341 341
                   </li>
342 342
 
343 343
                   <li v-if="!USER">
344
-                    <router-link class="btn-solid-blue pt-2 pb-2" to="/user/register"
344
+                    <router-link class="btn-white-border p-2 ml-1 mr-1" to="/user/register"
345 345
                       >Register</router-link
346 346
                     >
347 347
                   </li>

+ 1
- 1
src/components/timeshare/buy/carouselSection.vue Прегледај датотеку

@@ -143,7 +143,7 @@ export default {
143 143
         this.searchParams.regionObj = this.regionObj;
144 144
         this.$router.push("/timeshareToByResults");
145 145
       } else {
146
-        this.$router.push(`/resort/${this.searchParams.resort.resortCode}`);
146
+        this.$router.push(`/resort/${this.searchParams.resort.resortId}`);
147 147
       }
148 148
     }
149 149
   },

+ 1
- 1
src/components/timeshare/buy/searchSection.vue Прегледај датотеку

@@ -145,7 +145,7 @@ export default {
145 145
     },
146 146
     ShowResort() {
147 147
       if (this.selectedResort) {
148
-        this.$router.push(`/resort/${this.selectedResort.resortCode}`);
148
+        this.$router.push(`/resort/${this.selectedResort.resortId}`);
149 149
       }
150 150
     },
151 151
   },

+ 3
- 3
src/components/timeshare/buy/weekListComponent.vue Прегледај датотеку

@@ -168,9 +168,9 @@ export default {
168 168
     }
169 169
   },
170 170
   mounted() {
171
-    if (this.resortCode) {
172
-      this.applyResortFilter(this.resortCode);
173
-    }
171
+    //if (this.resortCode) {
172
+    //  this.applyResortFilter(this.resortCode);
173
+    //}
174 174
     this.getByResortCode(this.$route.params.resortCode);
175 175
     //this.getWeeks();
176 176
   },

+ 3
- 3
src/components/timeshare/resort/resortPage.vue Прегледај датотеку

@@ -2,7 +2,7 @@
2 2
   <div>
3 3
     <!-- <carouselSection v-if="boolLoaded" :resortImages="resort.images" /> -->
4 4
     <main id="main" style="margin-top:-20px">
5
-      <contentSection :resortCode="resortCode" />
5
+      <contentSection :resortId="resortId" />
6 6
     </main>
7 7
   </div>
8 8
 </template>
@@ -23,10 +23,10 @@ export default {
23 23
     };
24 24
   },
25 25
   props: {
26
-    resortCode: {}
26
+    resortId: {}
27 27
   },
28 28
   async created() {
29
-    this.getResortData(this.resortCode);
29
+    this.getResortData(this.resortId);
30 30
     // .then(() => {
31 31
     //   setTimeout(() => (this.boolLoaded = true), 2000);
32 32
     // });

+ 46
- 12
src/components/user/forgotPassword.vue Прегледај датотеку

@@ -10,13 +10,27 @@
10 10
       </div>
11 11
       <div class="row mb-4">
12 12
         <div class="col">
13
-          <alert :text="message" :type="status" />
13
+          <alert :text="errorMessage" :type="errorOccurred" />
14 14
         </div>
15 15
       </div>
16 16
       <div class="row">
17 17
         <div class="col-md-6">
18 18
           <float-label>
19
-            <input v-model="email" type="text" placeholder="EMAIL" class="form-control uniInput" />
19
+            <input
20
+            type="email"
21
+            id="email"
22
+            name="email"
23
+            placeholder="EMAIL"
24
+            class="form-control uniInput"
25
+            v-model="email"
26
+            v-bind:class="{'is-valid': email,
27
+             'is-invalid': !validEmail(email) && emailLoad}"
28
+            v-on:keyup="emailLoad = true"
29
+            v-on:blur="emailLoad = true"
30
+            required
31
+            icon
32
+            />
33
+            <div class="invalid-feedback">Valid Email is required!</div>
20 34
           </float-label>
21 35
         </div>
22 36
       </div>
@@ -30,7 +44,7 @@
30 44
 </template>
31 45
 
32 46
 <script>
33
-import { mapActions } from "vuex";
47
+import { mapActions } from 'vuex';
34 48
 /* eslint-disable */
35 49
 
36 50
 import alert from "../shared/alert";
@@ -42,25 +56,45 @@ export default {
42 56
   data() {
43 57
     return {
44 58
       email: "",
45
-      message: "",
46
-      status: ""
59
+      emailLoad: false,
60
+      errorOccurred: "",
61
+      errorMessage: ""
47 62
     };
48 63
   },
49 64
   methods: {
50 65
     ...mapActions("register", ["forgotPasswordCheck"]),
51 66
     checkMail() {
52
-      this.forgotPasswordCheck(this.email)
53
-        .then(res => {
54
-          this.message = "An email has been sent with instructions to reset your password.";
55
-          this.status = "SUCCESS";
67
+      if (this.email){
68
+        console.log(this.email);
69
+        this.forgotPasswordCheck(this.email)
70
+        .then(() => {
71
+          this.errorMessage = "An email has been sent with instructions to reset your password.";
72
+          this.errorOccurred = "SUCCESS";
56 73
         })
57
-        .catch(e => {
58
-          this.message = "The email was not found";
59
-          this.status = "ERROR";
74
+        .catch(err => {
75
+          //console.log(err);
76
+          this.errorOccurred = "ERROR";
77
+          this.errorMessage = "Server Error: CONNECTION_REFUSED";
78
+          if (err.status) {
79
+            if (err.data.message) {
80
+              this.errorMessage = err.data.message;
81
+            } else {
82
+              this.errorMessage = "Email address not found!"
83
+            }
84
+          }
60 85
         });
86
+      } else {
87
+          this.errorMessage = "A valid email is required.";
88
+          this.errorOccurred = "ERROR";
89
+      }
90
+    },
91
+    validEmail : function(email) {
92
+        var re = /(.+)@(.+){2,}\.(.+){2,}/;
93
+        return re.test(email.toLowerCase());
61 94
     }
62 95
   }
63 96
 };
64 97
 </script>
65 98
 
66 99
 <style lang="scss" scoped></style>
100
+

+ 61
- 15
src/components/user/loginPage.vue Прегледај датотеку

@@ -15,35 +15,52 @@
15 15
                     <div v-if="page">
16 16
                       <alert :text="page.text" :type="'INFO'" />
17 17
                     </div>
18
-                    <div class="form-label-group">
19
-                      <input
18
+                      <div class="form-label-group">
19
+                        <input
20 20
                         type="text"
21
-                        id="inputEmail"
21
+                        id="inputUsername"
22
+                        name="username"
23
+                        class="form-control uniInput"
22 24
                         v-model="username"
23
-                        class="form-control"
25
+                        v-bind:class="{'is-valid': username,
26
+                         'is-invalid': !requiredField(username) && usernameLoad}"
27
+                        v-on:keyup="usernameLoad = true"
28
+                        v-on:blur="usernameLoad = true"
24 29
                         placeholder="Username"
25 30
                         required
31
+                        icon
26 32
                         autofocus
27
-                      />
28
-                    </div>
33
+                        />
34
+                      <div class="invalid-feedback">Name is required!</div>
35
+                      </div>
36
+
29 37
                     <div class="form-label-group">
30 38
                       <input
31 39
                         type="password"
40
+                        id="inputPassword"
41
+                        name="password"
42
+                        class="form-control uniInput"
32 43
                         placeholder="Password"
33 44
                         v-model="password"
34
-                        id="inputPassword"
35
-                        class="form-control"
45
+                        v-bind:class="{'is-valid': password,
46
+                         'is-invalid': !requiredField(password) && passwordLoad}"
47
+                        v-on:keyup="passwordLoad = true"
48
+                        v-on:blur="passwordLoad = true"
49
+                        aria-required="icon"
36 50
                         required
51
+                        icon
37 52
                       />
53
+                      <div class="invalid-feedback">Password is required!</div>
38 54
                     </div>
55
+
39 56
                     <div class="custom-control custom-checkbox mb-3">
40 57
                       <input type="checkbox" class="custom-control-input" id="customCheck1" />
41 58
                       <label class="custom-control-label" for="customCheck1"
42 59
                         >Remember password?</label
43 60
                       >
44 61
                     </div>
45
-
46 62
                     <button v-on:click="Login()" class="btn-solid-blue" type="submit">
63
+                    <!-- <button class="btn-solid-blue" type="submit"> -->
47 64
                       LOGIN
48 65
                     </button>
49 66
                     <router-link style="float:right" to="/user/forgotPassword"
@@ -97,7 +114,9 @@ export default {
97 114
   data() {
98 115
     return {
99 116
       username: "",
117
+      usernameLoad: false,
100 118
       password: "",
119
+      passwordLoad: false,
101 120
       errorOccurred: "",
102 121
       errorMessage: "",
103 122
       isPasswordShown: "password",
@@ -127,10 +146,10 @@ export default {
127 146
     },
128 147
     Login() {
129 148
       console.log(this.username + " " + this.password);
149
+      if (this.validate()){
130 150
       this.login({ username: this.username, password: this.password })
131 151
         .then(() => {
132
-          // console.log(Log.getUser());
133
-
152
+          console.log(Log.getUser());
134 153
           if (!this.page) {
135 154
             if (!Log.getUser().loginPasswordChange) {
136 155
               this.$router.push("/");
@@ -142,12 +161,21 @@ export default {
142 161
           }
143 162
         })
144 163
         .catch(err => {
164
+          console.log("Catch here");
165
+          console.log(this.status);
166
+          this.errorOccurred = "ERROR";
167
+          this.errorMessage = "Server Error: CONNECTION_REFUSED"; 
145 168
           console.log(err.status);
146
-          if (err.status === 401) {
147
-            this.errorOccurred = "ERROR";
148
-            this.errorMessage = err.data.message;
169
+          if (err.status) {
170
+            if (err.data.message) {
171
+              this.errorMessage = err.data.message;
172
+            } else {
173
+              this.errorMessage = "Username or passord is incorrect."
174
+            }
149 175
           }
150
-        });
176
+        }
177
+        ); 
178
+      }
151 179
     },
152 180
     checkUserStatus() {
153 181
       if (Log.isLoggedIn()) {
@@ -166,6 +194,24 @@ export default {
166 194
     SendMail() {},
167 195
     routerGoTo(goTo) {
168 196
       this.$router.push(goTo);
197
+    },
198
+    validate : function(){
199
+      if (this.username && this.password){
200
+        this.errorOccurred = '';
201
+        this.errorMessage = '';
202
+        return true;
203
+      } else {
204
+        this.errorOccurred = "ERROR";
205
+        this.errorMessage = "Username or passord is incorrect.";
206
+        return false;
207
+      }
208
+    },
209
+    requiredField : function(tfield) {
210
+      if(tfield){
211
+        return true;
212
+      } else {
213
+        return false;
214
+      }
169 215
     }
170 216
   }
171 217
 };

+ 39
- 16
src/components/user/registerAgencySection.vue Прегледај датотеку

@@ -5,7 +5,7 @@
5 5
       <div class="col-sm-12 col-md-6">
6 6
         <input
7 7
           type="text"
8
-          id="inputName"
8
+          id="inputAgencyName"
9 9
           v-model="registerAgency.name"
10 10
           class="form-control uniInput"
11 11
           placeholder="Agency Name"
@@ -16,7 +16,7 @@
16 16
       <div class="col-sm-12 col-md-6">
17 17
         <input
18 18
           type="text"
19
-          id="inputName"
19
+          id="inputAgencyNumber"
20 20
           v-model="registerAgency.eaabeffcNumber"
21 21
           class="form-control uniInput"
22 22
           placeholder="EAAB FFC Number"
@@ -29,7 +29,7 @@
29 29
       <div class="col-sm-12">
30 30
         <input
31 31
           type="text"
32
-          id="inputName"
32
+          id="inputAgencyCompanyRegistration"
33 33
           v-model="registerAgency.companyRegNumber"
34 34
           class="form-control uniInput"
35 35
           placeholder="Company Registration Number"
@@ -44,7 +44,7 @@
44 44
       <div class="col-sm-12 col-md-6">
45 45
         <input
46 46
           type="text"
47
-          id="inputName"
47
+          id="inputAgencyAdmin"
48 48
           v-model="registerAgency.user.name"
49 49
           class="form-control uniInput my-3"
50 50
           placeholder="Name"
@@ -54,7 +54,7 @@
54 54
 
55 55
         <input
56 56
           type="text"
57
-          id="inputSurname"
57
+          id="inputAgencySurname"
58 58
           v-model="registerAgency.user.surname"
59 59
           class="form-control uniInput my-3"
60 60
           placeholder="Surname"
@@ -64,7 +64,7 @@
64 64
 
65 65
         <input
66 66
           type="email"
67
-          id="inputEmail"
67
+          id="inputAgencyEmail"
68 68
           v-model="registerAgency.user.email"
69 69
           class="form-control uniInput my-3"
70 70
           placeholder="Email"
@@ -75,7 +75,7 @@
75 75
       <div class="col-sm-12 col-md-6">
76 76
         <input
77 77
           type="text"
78
-          id="inputCellphone"
78
+          id="inputAgencyCellphone"
79 79
           v-model="registerAgency.user.cellNumber"
80 80
           class="form-control uniInput my-3"
81 81
           placeholder="Cellphone Number"
@@ -85,7 +85,7 @@
85 85
 
86 86
         <input
87 87
           type="text"
88
-          id="inputLandLine"
88
+          id="inputAgencyLandLine"
89 89
           v-model="registerAgency.user.telephone"
90 90
           class="form-control uniInput"
91 91
           placeholder="Landline Number"
@@ -99,7 +99,7 @@
99 99
       <div class="col-sm-12">
100 100
         <input
101 101
           type="text"
102
-          id="inputUsername"
102
+          id="inputAgencyUsername"
103 103
           v-model="registerAgency.user.username"
104 104
           class="form-control uniInput"
105 105
           placeholder="Username"
@@ -114,7 +114,7 @@
114 114
           type="password"
115 115
           placeholder="Password"
116 116
           v-model="registerAgency.user.password"
117
-          id="inputPassword uniInput"
117
+          id="inputAgencyPassword uniInput"
118 118
           class="form-control uniInput"
119 119
           required
120 120
         />
@@ -124,7 +124,7 @@
124 124
           type="password"
125 125
           placeholder="Confirm Password"
126 126
           v-model="registerAgency.user.password"
127
-          id="inputPasswordConfirm"
127
+          id="inputAgencyPasswordConfirm"
128 128
           class="form-control uniInput"
129 129
           required
130 130
         />
@@ -144,10 +144,11 @@
144 144
       </div>
145 145
     </div>
146 146
     <button
147
-      v-if="registerAgency.user.acceptedTerms"
148
-      v-on:click="SubmitData()"
149
-      class="btn-solid-blue"
150
-      type="submit"
147
+        v-if="registerAgency.user.acceptedTerms"
148
+        :disabled="isDisabled"
149
+        v-on:click="SubmitData()"
150
+        :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
151
+        type="submit"
151 152
     >
152 153
       SUBMIT
153 154
     </button>
@@ -233,4 +234,26 @@ export default {
233 234
 };
234 235
 </script>
235 236
 
236
-<style lang="scss" scoped></style>
237
+<style lang="scss" scoped>
238
+.btn-disabled {
239
+  font-family: "Muli";
240
+  font-size: 15px;
241
+  letter-spacing: 1px;
242
+  display: inline-block;
243
+  padding: 10px 32px;
244
+  border-radius: 2px;
245
+  transition: 0.5s;
246
+  margin: 10px;
247
+  color: #fff;
248
+  background: grey;
249
+  border-color: black;
250
+  color: black;
251
+  cursor: not-allowed;
252
+}
253
+.btn-disabled :hover {
254
+  background: grey;
255
+  border-color: black;
256
+  color: black;
257
+  cursor: not-allowed;
258
+}
259
+</style>

+ 144
- 49
src/components/user/registerIndividual.vue Прегледај датотеку

@@ -13,61 +13,78 @@
13 13
       </div>
14 14
       <div v-if="boolValidationError" class="row">
15 15
         <div class="col">
16
-          <alert :text="validationErrorMessage" :type="'ERROR'" />
16
+          <alert :text="errorMessage" :type="errorOccurred" />
17 17
         </div>
18 18
       </div>
19
-      <div class="row">
19
+      <div class="row needs-validation">
20 20
         <div class="col-sm-12 col-md-6 ">
21
-          <input
22
-            type="text"
23
-            id="inputName"
24
-            v-model="indivUser.name"
25
-            class="form-control uniInput my-2"
26
-            placeholder="Name"
27
-            required
28
-            autofocus
29
-          />
30
-
31
-          <input
32
-            type="text"
33
-            id="inputSurname"
34
-            v-model="indivUser.surname"
35
-            class="form-control uniInput my-2"
36
-            placeholder="Surname"
37
-            required
38
-            autofocus
39
-          />
40
-
41
-          <input
42
-            type="email"
43
-            id="inputEmail"
44
-            v-model="indivUser.email"
45
-            class="form-control uniInput my-2"
46
-            placeholder="Email"
47
-            required
48
-            autofocus
49
-          />
21
+          <div class="form-group">
22
+            <b-form-input
23
+              type="text"
24
+              id="inputName"
25
+              class="form-control uniInput my-2"
26
+              v-model="indivUser.name"
27
+              v-bind:class="{'is-valid': indivUser.name,
28
+                'is-invalid': !requiredField(indivUser.name) && nameLoad}"
29
+              v-on:keyup="nameLoad = true"
30
+              v-on:blur="nameLoad = true"
31
+              placeholder="Name"
32
+            />
33
+            <div class="invalid-feedback">Name is required!</div>
34
+          </div>
35
+          <div class="form-group">
36
+            <b-form-input
37
+              type="text"
38
+              id="inputSurname"
39
+              class="form-control uniInput my-2"
40
+              v-model="indivUser.surname"
41
+              v-bind:class="{'is-valid': indivUser.surname,
42
+                'is-invalid': !requiredField(indivUser.surname) && surnameLoad}"
43
+              v-on:keyup="surnameLoad = true"
44
+              v-on:blur="surnameLoad = true"
45
+              placeholder="Surname"
46
+            />
47
+            <div class="invalid-feedback">Surname is required!</div>
48
+          </div>
49
+          <div class="form-group">
50
+            <input
51
+              type="email"
52
+              id="inputEmail"
53
+              v-model="indivUser.email"
54
+              class="form-control uniInput my-2"
55
+              v-bind:class="{'is-valid': indivUser.email,
56
+                'is-invalid': !validEmail(indivUser.email) && emailLoad}"
57
+              v-on:keyup="emailLoad = true"
58
+              v-on:blur="emailLoad = true"
59
+              placeholder="Email"
60
+            />
61
+            <div class="invalid-feedback">Valid email address is required!</div>
62
+          </div>
50 63
         </div>
64
+
51 65
         <div class="col-sm-12 col-md-6">
52 66
           <input
53 67
             type="text"
54
-            id="inputCellphone"
68
+            id="inputCellNumber"
69
+            name="inputCellNumber"
55 70
             v-model="indivUser.cellNumber"
56 71
             class="form-control uniInput my-2"
72
+            v-bind:class="{'is-valid': indivUser.cellNumber,
73
+                'is-invalid': !requiredField(indivUser.cellNumber) && cellNumberLoad}"
74
+            v-on:keyup="cellNumberLoad = true"
75
+            v-on:blur="cellNumberLoad = true"
57 76
             placeholder="Cellphone Number"
58
-            required
59
-            autofocus
60 77
           />
78
+          <div class="invalid-feedback">Cellphone number is required!</div>
61 79
 
62 80
           <input
63 81
             type="text"
64
-            id="inputLandLine"
82
+            id="inputTelephone"
65 83
             v-model="indivUser.telephone"
66 84
             class="form-control uniInput my-2"
67 85
             placeholder="Landline Number"
68
-            required
69
-            autofocus
70 86
           />
87
+          <div class="invalid-feedback">Landline number is required!</div>
71 88
         </div>
72 89
       </div>
73 90
       <hr />
@@ -78,10 +95,13 @@
78 95
             id="inputUsername"
79 96
             v-model="indivUser.username"
80 97
             class="form-control uniInput my-2"
98
+            v-bind:class="{'is-valid': indivUser.username,
99
+                'is-invalid': !requiredField(indivUser.username) && usernameLoad}"
100
+            v-on:keyup="usernameLoad = true"
101
+            v-on:blur="usernameLoad = true"
81 102
             placeholder="Username"
82
-            required
83
-            autofocus
84 103
           />
104
+          <div class="invalid-feedback">Username is required!</div>
85 105
         </div>
86 106
       </div>
87 107
       <div class="row">
@@ -92,18 +112,26 @@
92 112
             v-model="indivUser.password"
93 113
             id="inputPassword"
94 114
             class="form-control uniInput my-2"
95
-            required
115
+            v-bind:class="{'is-valid': indivUser.password,
116
+                'is-invalid': !requiredField(indivUser.password) && passwordLoad}"
117
+            v-on:keyup="passwordLoad = true"
118
+            v-on:blur="passwordLoad = true"
96 119
           />
120
+          <div class="invalid-feedback">Password is required!</div>
97 121
         </div>
98 122
         <div class="col">
99 123
           <input
100 124
             type="password"
101 125
             placeholder="Confirm Password"
102
-            v-model="indivUser.confirmpassword"
103
-            id="inputPasswordConfirm"
126
+            v-model="indivUser.confirmPassword"
127
+            id="inputConfirmPassword"
104 128
             class="form-control uniInput my-2"
105
-            required
129
+            v-bind:class="{'is-valid': indivUser.confirmPassword,
130
+                'is-invalid': !validConfirm(indivUser.confirmPassword) && confirmPasswordLoad}"
131
+            v-on:keyup="confirmPasswordLoad = true"
132
+            v-on:blur="confirmPasswordLoad = true"
106 133
           />
134
+          <div class="invalid-feedback">Password and Confirm password must be the same!</div>
107 135
         </div>
108 136
       </div>
109 137
       <div class="row">
@@ -116,9 +144,9 @@
116 144
         </div>
117 145
       </div>
118 146
       <button
119
-        :disabled="isDisabled"
147
+        v-if="terms"
148
+        class="btn-white-border"
120 149
         v-on:click="SubmitData()"
121
-        :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
122 150
         type="submit"
123 151
       >
124 152
         SUBMIT
@@ -155,7 +183,6 @@ export default {
155 183
   name: "PrivateIndividual",
156 184
   data() {
157 185
     return {
158
-      user: undefined,
159 186
       isPasswordShown: "password",
160 187
       selectItems: [{ text: "password", value: 0 }],
161 188
       selectErrors: "Some error with the field",
@@ -165,10 +192,29 @@ export default {
165 192
       showPassword: false,
166 193
       boolMessage: false,
167 194
       terms: false,
168
-      indivUser: {},
195
+      indivUser: {
196
+        name: '',
197
+        surname: '',
198
+        email:'',
199
+        cellNumber: '',
200
+        telephone: '',
201
+        username: '',
202
+        password: '',
203
+        confirmPassword: ''
204
+      },
169 205
       boolUserExists: false,
170 206
       boolValidationError: false,
171
-      validationErrorMessage: ""
207
+      nameLoad: false,
208
+      surnameLoad: false,
209
+      emailLoad: false,
210
+      cellNumberLoad: false,
211
+      telephoneLoad: false,
212
+      usernameLoad: false,
213
+      passwordLoad: false,
214
+      confirmPasswordLoad: false,
215
+      errorOccurred: "",
216
+      errorMessage: "",
217
+      valid: false
172 218
     };
173 219
   },
174 220
   computed: {
@@ -203,7 +249,7 @@ export default {
203 249
     SubmitData() {
204 250
       this.indivUser.acceptedTerms = this.terms;
205 251
       console.log(this.indivUser.email);
206
-      if (this.indivUser.email) {
252
+      if (this.validatePage()) {
207 253
         console.log(this.indivUser.username);
208 254
         if (this.indivUser.username) {
209 255
           this.saveIndividual(this.indivUser)
@@ -233,6 +279,55 @@ export default {
233 279
     },
234 280
     Close() {
235 281
       this.$router.push("/user/login");
282
+    },
283
+    validatePage : function(){
284
+      console.log('validatePage')
285
+      if (this.indivUser.name && this.indivUser.surname && this.indivUser.email 
286
+         && this.indivUser.cellNumber && this.indivUser.telephone && this.indivUser.username && this.indivUser.password
287
+         && this.indivUser.password === this.indivUser.confirmPassword){
288
+        this.errorOccurred = '';
289
+        this.errorMessage = '';
290
+        this.valid = true;
291
+        return true;
292
+      } else {
293
+        this.valid = false;
294
+        this.nameLoad = true,
295
+        this.surnameLoad = true,
296
+        this.emailLoad = true,
297
+        this.cellNumberLoad= true,
298
+        this.telephoneLoad = true,
299
+        this.usernameLoad = true,
300
+        this.passwordLoad = true,
301
+        this.confirmPasswordLoad = true,
302
+        this.errorOccurred = "ERROR";
303
+        this.errorMessage = "Please check form and correct all input fields!";
304
+        return false;
305
+      }
306
+    },
307
+    requiredField : function(tfield) {
308
+      if(tfield){
309
+        return true;
310
+      } else {
311
+        return false;
312
+      }
313
+    },
314
+    validEmail : function(email) {
315
+        var re = /(.+)@(.+){2,}\.(.+){2,}/;
316
+        return re.test(email.toLowerCase());
317
+    },
318
+    validConfirm : function(tfield) {
319
+      console.log(tfield);
320
+      if (this.requiredField(tfield)){
321
+        console.log(tfield);
322
+        console.log(this.indivUser.password);
323
+        if(tfield === this.indivUser.password){
324
+          return true;
325
+        } else {
326
+          return false;
327
+        } 
328
+      } else {
329
+        return false;
330
+      }
236 331
     }
237 332
   }
238 333
 };

+ 2
- 0
src/components/user/registerPage.vue Прегледај датотеку

@@ -134,6 +134,7 @@ export default {
134 134
   border-top: none;
135 135
   border-left: none;
136 136
   border-right: none;
137
+  background-color: rgb(221, 221, 221);
137 138
   border-bottom-color: rgb(221, 221, 221);
138 139
 }
139 140
 
@@ -145,6 +146,7 @@ export default {
145 146
   border-top: none;
146 147
   border-left: none;
147 148
   border-right: none;
149
+  background-color: rgb(80, 133, 240);
148 150
   border-bottom-color: rgb(221, 221, 221);
149 151
 }
150 152
 

+ 97
- 91
src/main.js Прегледај датотеку

@@ -1,116 +1,122 @@
1 1
 /* eslint-disable */
2
-import Vue from "vue";
3
-import EvaIcons from "vue-eva-icons";
4
-import axios from "axios";
5
-import moment from "moment";
6
-import App from "./App.vue";
7
-import router from "./router";
8
-import store from "./store";
9
-import * as VueGoogleMaps from "vue2-google-maps";
10
-import Vuetify from "vuetify";
11
-import VueSocialSharing from "vue-social-sharing";
12
-import VueCurrencyInput from "vue-currency-input";
13
-import VueFloatLabel from "vue-float-label";
14
-import VueCryptojs from "vue-cryptojs";
15
-import VueAnalytics from 'vue-analytics';
16
-import JsonExcel from "vue-json-excel";
17
-import VModal from "vue-js-modal";
18
-import vueFloatLabel from "vue-float-label";
19
-import 'vue-loaders/dist/vue-loaders.css';
20
-import VueLoaders from 'vue-loaders';
2
+import Vue from 'vue'
3
+import EvaIcons from 'vue-eva-icons'
4
+import axios from 'axios'
5
+import moment from 'moment'
6
+import App from './App.vue'
7
+import router from './router'
8
+import store from './store'
9
+import * as VueGoogleMaps from 'vue2-google-maps'
10
+import Vuetify from 'vuetify'
11
+import VueSocialSharing from 'vue-social-sharing'
12
+import VueCurrencyInput from 'vue-currency-input'
13
+import VueFloatLabel from 'vue-float-label'
14
+import VueCryptojs from 'vue-cryptojs'
15
+import VueAnalytics from 'vue-analytics'
16
+import JsonExcel from 'vue-json-excel'
17
+import VModal from 'vue-js-modal'
18
+import vueFloatLabel from 'vue-float-label'
19
+import 'vue-loaders/dist/vue-loaders.css'
20
+import VueLoaders from 'vue-loaders'
21 21
 import VueQuillEditor from 'vue-quill-editor'
22
-
22
+import 'bootstrap/dist/css/bootstrap.css'
23
+import 'bootstrap-vue/dist/bootstrap-vue.css'
24
+import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
23 25
 import 'quill/dist/quill.core.css' // import styles
24 26
 import 'quill/dist/quill.snow.css' // for snow theme
25 27
 import 'quill/dist/quill.bubble.css' // for bubble theme
26 28
 
27
-Vue.use(VueQuillEditor, /* { default global options } */)
28
-Vue.use(VueLoaders);
29
-Vue.use(VueSocialSharing);
30
-Vue.use(EvaIcons);
31
-Vue.use(Vuetify);
32
-Vue.use(VueFloatLabel);
33
-Vue.use(VueCryptojs);
34
-Vue.component("downloadExcel", JsonExcel);
29
+Vue.use(VueQuillEditor /* { default global options } */ )
30
+Vue.use(VueLoaders)
31
+Vue.use(VueSocialSharing)
32
+Vue.use(EvaIcons)
33
+Vue.use(Vuetify)
34
+Vue.use(VueFloatLabel)
35
+Vue.use(VueCryptojs)
36
+Vue.component('downloadExcel', JsonExcel)
37
+Vue.use(BootstrapVue)
38
+Vue.use(IconsPlugin)
35 39
 
36 40
 Vue.use(VueGoogleMaps, {
37
-  load: {
38
-    key: "AIzaSyD8k_Kwml_C8IDfs-gX8JFV8acli3L9cAE",
39
-    libraries: "places,directions" // This is required if you use the Autocomplete plugin
40
-    // OR: libraries: 'places,drawing'
41
-    // OR: libraries: 'places,drawing,visualization'
42
-    // (as you require)
41
+        load: {
42
+            key: 'AIzaSyD8k_Kwml_C8IDfs-gX8JFV8acli3L9cAE',
43
+            libraries: 'places,directions', // This is required if you use the Autocomplete plugin
44
+            // OR: libraries: 'places,drawing'
45
+            // OR: libraries: 'places,drawing,visualization'
46
+            // (as you require)
43 47
 
44
-    //// If you want to set the version, you can do so:
45
-    // v: '3.26',
46
-  }
47
-});
48
-//More info @ https://webdeasy.de/en/vue-analytics-en/
48
+            //// If you want to set the version, you can do so:
49
+            // v: '3.26',
50
+        },
51
+    })
52
+    //More info @ https://webdeasy.de/en/vue-analytics-en/
49 53
 Vue.use(VueAnalytics, {
50
-  id: 'UA-128891091-1',
51
-  router
52
-});
54
+    id: 'UA-128891091-1',
55
+    router,
56
+})
53 57
 
54
-Vue.config.productionTip = false;
55
-//axios.defaults.baseURL = "http://localhost:57260";
56
-//axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
57
-axios.defaults.baseURL = "http://training.provision-sa.com:120/";
58
-//axios.defaults.baseURL = "http://localhost:8080/"
58
+Vue.config.productionTip = false
59
+axios.defaults.baseURL = 'http://localhost:57260'
60
+    //axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
61
+    //axios.defaults.baseURL = "http://training.provision-sa.com:120/";
62
+    //axios.defaults.baseURL = "http://localhost:8080/"
59 63
 
60
-Vue.prototype.$axios = axios;
64
+Vue.prototype.$axios = axios
61 65
 const pluginOptions = {
62
-  /* see config reference */
63
-  globalOptions: {
64
-    currency: ["ZAR", null, { prefix: "R" }][2],
65
-    precision: 0
66
-  }
67
-};
68
-Vue.use(VueCurrencyInput, pluginOptions);
69
-Vue.prototype.$http = axios;
70
-const token = localStorage.getItem("token");
66
+    /* see config reference */
67
+    globalOptions: {
68
+        currency: ['ZAR', null, { prefix: 'R' }][2],
69
+        precision: 0,
70
+    },
71
+}
72
+Vue.use(VueCurrencyInput, pluginOptions)
73
+Vue.prototype.$http = axios
74
+const token = localStorage.getItem('token')
71 75
 if (token) {
72
-  Vue.prototype.$http.defaults.headers.common.Authorization = token;
76
+    Vue.prototype.$http.defaults.headers.common.Authorization = token
73 77
 }
74 78
 
75 79
 router.beforeEach((to, from, next) => {
76
-  if (to.matched.some(record => record.meta.requiresAuth)) {
77
-    if (store.getters.isLoggedIn) {
78
-      next();
79
-      return;
80
+    if (to.matched.some((record) => record.meta.requiresAuth)) {
81
+        if (store.getters.isLoggedIn) {
82
+            next()
83
+            return
84
+        }
85
+        next('/users/login')
86
+    } else {
87
+        next()
80 88
     }
81
-    next("/users/login");
82
-  } else {
83
-    next();
84
-  }
85
-});
89
+})
86 90
 
87
-Vue.filter("toCurrency", value => {
88
-  if (typeof value !== "number") {
89
-    return value;
90
-  }
91
-  const formatter = new Intl.NumberFormat("en-US", {
92
-    minimumFractionDigits: 0
93
-  });
94
-  return `R ${formatter.format(value)}`;
95
-});
91
+Vue.filter('toCurrency', (value) => {
92
+    if (typeof value !== 'number') {
93
+        return value
94
+    }
95
+    const formatter = new Intl.NumberFormat('en-US', {
96
+        minimumFractionDigits: 0,
97
+    })
98
+    return `R ${formatter.format(value)}`
99
+})
96 100
 
97
-Vue.filter("toProper", value => {
98
-  if (typeof value !== "string") {
99
-    console.log(typeof value);
100
-    return value;
101
-  }
102
-  value = value.replace(/([a-z])([A-Z])/g, "$1 $2");
103
-  return value.charAt(0).toUpperCase() + value.slice(1);
104
-});
101
+Vue.filter('toProper', (value) => {
102
+    if (typeof value !== 'string') {
103
+        console.log(typeof value)
104
+        return value
105
+    }
106
+    value = value.replace(/([a-z])([A-Z])/g, '$1 $2')
107
+    return value.charAt(0).toUpperCase() + value.slice(1)
108
+})
105 109
 
106
-Vue.filter("toDate", value => value.substring(0, value.length > 9 ? 10 : value.length));
110
+Vue.filter('toDate', (value) =>
111
+    value.substring(0, value.length > 9 ? 10 : value.length),
112
+)
107 113
 
108
-Vue.filter("toTime", value => moment(String(value)).format("hh:mm"));
114
+Vue.filter('toTime', (value) => moment(String(value)).format('hh:mm'))
109 115
 
110 116
 new Vue({
111
-  render: h => h(App),
112
-  router,
113
-  store
114
-}).$mount("#app");
117
+    render: (h) => h(App),
118
+    router,
119
+    store,
120
+}).$mount('#app')
115 121
 
116
-Vue.use(VModal);
122
+Vue.use(VModal)

+ 121
- 129
src/store/modules/timeshare/region.js Прегледај датотеку

@@ -1,139 +1,131 @@
1 1
 /* eslint-disable no-restricted-syntax */
2 2
 /* eslint-disable guard-for-in */
3
-import axios from 'axios';
3
+import axios from 'axios'
4 4
 
5 5
 export default {
6
-  namespaced: true,
7
-  state: {
8
-    regions: [],
9
-    detailedRegion: [],
10
-    availRegion: [],
11
-    initFlag: false,
12
-  },
13
-  mutations: {
14
-    addItem(state, item) {
15
-      state[item.name].push(item.value);
6
+    namespaced: true,
7
+    state: {
8
+        regions: [],
9
+        detailedRegion: [],
10
+        availRegion: [],
11
+        initFlag: false,
16 12
     },
17
-    setItem(state, item) {
18
-      state[item.name] = item.value;
13
+    mutations: {
14
+        addItem(state, item) {
15
+            state[item.name].push(item.value)
16
+        },
17
+        setItem(state, item) {
18
+            state[item.name] = item.value
19
+        },
19 20
     },
20
-  },
21
-  getters: {},
22
-  actions: {
23
-    init({
24
-      state,
25
-      commit,
26
-      dispatch,
27
-    }) {
28
-      if (!state.initFlag) {
29
-        commit('setItem', {
30
-          name: 'availRegion',
31
-          value: [],
32
-        });
33
-        dispatch('getAvail');
34
-        dispatch('getRegions');
35
-        commit('setItem', {
36
-          name: 'initFlag',
37
-          value: true,
38
-        });
39
-      }
40
-    },
41
-    forceInit({
42
-      commit,
43
-      dispatch,
44
-    }) {
45
-      commit('setItem', {
46
-        name: 'initFlag',
47
-        value: false,
48
-      });
49
-      dispatch('init');
50
-    },
51
-    getAvail({
52
-      commit,
53
-    }) {
54
-      axios.get('/api/timeshareweek/getAvailResort').then((r) => {
55
-        for (const reg in r.data) {
56
-          const newRegion = {};
57
-          newRegion.regionCode = r.data[reg].regionCode;
58
-          newRegion.regionName = r.data[reg].regionName;
59
-          newRegion.available = r.data[reg].available;
60
-          newRegion.resorts = [];
61
-          for (const res in r.data[reg].resorts) {
62
-            const newResort = {
63
-              resortCode: '',
64
-              resortName: '',
65
-              lat: 0,
66
-              long: 0,
67
-            };
68
-            newResort.resortCode = r.data[reg].resorts[res].resortCode;
69
-            newResort.resortName = r.data[reg].resorts[res].resortName;
70
-            newResort.available = r.data[reg].resorts[res].available;
71
-            if (r.data[reg].resorts[res]) {
72
-              axios.get(
73
-                `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/TRESORT/${
74
-                  r.data[reg].resorts[res].resortCode}`,
75
-              )
76
-                .then((result) => {
77
-                  newResort.lat = result.data.prLatitude;
78
-                  newResort.long = result.data.prLongitude;
21
+    getters: {},
22
+    actions: {
23
+        init({ state, commit, dispatch }) {
24
+            if (!state.initFlag) {
25
+                commit('setItem', {
26
+                    name: 'availRegion',
27
+                    value: [],
28
+                })
29
+                dispatch('getAvail')
30
+                dispatch('getRegions')
31
+                commit('setItem', {
32
+                    name: 'initFlag',
33
+                    value: true,
79 34
                 })
80
-                .catch(console.error);
81 35
             }
82
-            newRegion.resorts.push(newResort);
83
-          }
84
-          commit('addItem', {
85
-            name: 'availRegion',
86
-            value: newRegion,
87
-          });
88
-        }
89
-      }).catch(
90
-        console
91
-          .error,
92
-      );
93
-    },
94
-    getRegions({
95
-      commit,
96
-      dispatch,
97
-    }) {
98
-      commit('setItem', {
99
-        name: 'detailedRegion',
100
-        value: [],
101
-      });
102
-      axios.get(
103
-        'https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/regions/list/ZA/',
104
-      )
105
-        .then((result) => {
106
-          commit('setItem', {
107
-            name: 'regions',
108
-            value: result.data,
109
-          });
110
-          if (result.data) {
111
-            for (const i in result.data) {
112
-              const region = result.data[i];
113
-              dispatch('getDetailedRegion', region);
36
+        },
37
+        forceInit({ commit, dispatch }) {
38
+            commit('setItem', {
39
+                name: 'initFlag',
40
+                value: false,
41
+            })
42
+            dispatch('init')
43
+        },
44
+        getAvail({ commit }) {
45
+            axios
46
+                .get('/api/timeshareweek/getAvailResort')
47
+                .then((r) => {
48
+                    for (const reg in r.data) {
49
+                        const newRegion = {}
50
+                        newRegion.regionCode = r.data[reg].regionCode
51
+                        newRegion.regionName = r.data[reg].regionName
52
+                        newRegion.available = r.data[reg].available
53
+                        newRegion.resorts = []
54
+                        for (const res in r.data[reg].resorts) {
55
+                            const newResort = {
56
+                                resortId: '',
57
+                                resortCode: '',
58
+                                resortName: '',
59
+                                lat: 0,
60
+                                long: 0,
61
+                            }
62
+                            newResort.resortCode = r.data[reg].resorts[res].resortCode
63
+                            newResort.resortName = r.data[reg].resorts[res].resortName
64
+                            newResort.available = r.data[reg].resorts[res].available
65
+                            newResort.resortId = r.data[reg].resorts[res].resortId
66
+                            if (r.data[reg].resorts[res]) {
67
+                                axios
68
+                                    .get(
69
+                                        `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/TRESORT/${r.data[reg].resorts[res].resortId}`,
70
+                                    )
71
+                                    .then((result) => {
72
+                                        newResort.lat = result.data.prLatitude
73
+                                        newResort.long = result.data.prLongitude
74
+                                    })
75
+                                    .catch(console.error)
76
+                            }
77
+                            newRegion.resorts.push(newResort)
78
+                        }
79
+                        commit('addItem', {
80
+                            name: 'availRegion',
81
+                            value: newRegion,
82
+                        })
83
+                    }
84
+                })
85
+                .catch(console.error)
86
+        },
87
+        getRegions({ commit, dispatch }) {
88
+            commit('setItem', {
89
+                name: 'detailedRegion',
90
+                value: [],
91
+            })
92
+            axios
93
+                .get(
94
+                    'https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/regions/list/ZA/',
95
+                )
96
+                .then((result) => {
97
+                    commit('setItem', {
98
+                        name: 'regions',
99
+                        value: result.data,
100
+                    })
101
+                    if (result.data) {
102
+                        for (const i in result.data) {
103
+                            const region = result.data[i]
104
+                            dispatch('getDetailedRegion', region)
105
+                        }
106
+                    }
107
+                })
108
+                .catch(console.error)
109
+        },
110
+        getDetailedRegion({ commit }, region) {
111
+            if (region) {
112
+                axios
113
+                    .get(
114
+                        `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/resorts/${region.regionCode}/`,
115
+                    )
116
+                    .then((result) =>
117
+                        commit('addItem', {
118
+                            name: 'detailedRegion',
119
+                            value: {
120
+                                id: region.id,
121
+                                regionCode: region.regionCode,
122
+                                regionName: region.regionName,
123
+                                resorts: result.data,
124
+                            },
125
+                        }),
126
+                    )
127
+                    .catch(console.error)
114 128
             }
115
-          }
116
-        })
117
-        .catch(console.error);
118
-    },
119
-    getDetailedRegion({
120
-      commit,
121
-    }, region) {
122
-      if (region) {
123
-        axios
124
-          .get(`https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/resorts/${
125
-            region.regionCode}/`)
126
-          .then(result => commit('addItem', {
127
-            name: 'detailedRegion',
128
-            value: {
129
-              id: region.id,
130
-              regionCode: region.regionCode,
131
-              regionName: region.regionName,
132
-              resorts: result.data,
133
-            },
134
-          }))
135
-          .catch(console.error);
136
-      }
129
+        },
137 130
     },
138
-  },
139
-};
131
+}

+ 168
- 166
src/store/modules/timeshare/resort.js Прегледај датотеку

@@ -1,171 +1,173 @@
1 1
 /* eslint-disable no-restricted-syntax */
2 2
 /* eslint-disable guard-for-in */
3 3
 /* eslint-disable */
4
-import axios from "axios";
5
-import { reject } from "core-js/fn/promise";
4
+import axios from 'axios'
5
+import { reject } from 'core-js/fn/promise'
6 6
 
7 7
 export default {
8
-  namespaced: true,
9
-  state: {
10
-    resorts: [],
11
-    resort: {},
12
-    images: [],
13
-    layout: "",
14
-    description: "",
15
-    resortMedia: undefined,
16
-    resortsWithListings: []
17
-  },
18
-  mutations: {
19
-    setResort(state, resort) {
20
-      state.resort = resort;
21
-    },
22
-    setDescription(state, description) {
23
-      state.description = description;
24
-    },
25
-    addImage(state, image) {
26
-      state.images.push(`data:image/jpeg;base64,${image}`);
27
-    },
28
-    clear(state) {
29
-      state.resort = {};
30
-      state.images = [];
31
-      state.layout = "";
32
-    },
33
-    setLayout(state, image) {
34
-      state.layout = `data:image/jpeg;base64,${image}`;
35
-    },
36
-    setResorts(state, list) {
37
-      state.resorts = list;
38
-    },
39
-    setResortMedia(state, media) {
40
-      state.resortMedia = media;
41
-    },
42
-    setResortsWithListings(state, data){
43
-      state.resortsWithListings = data
44
-    }
45
-  },
46
-  getters: {},
47
-  actions: {
48
-    async initResort({ commit, dispatch }, resortCode) {
49
-      commit("clear");
50
-      await dispatch("getResort", resortCode);
51
-      dispatch("getDescription", resortCode);
52
-      dispatch("getImage1", resortCode);
53
-      dispatch("getImage2", resortCode);
54
-      dispatch("getImage3", resortCode);
55
-      dispatch("getImage4", resortCode);
56
-      dispatch("getImage5", resortCode);
57
-      dispatch("getLayout", resortCode);
58
-    },
59
-    getDescription({ commit }, resortCode) {
60
-      axios
61
-        .get(
62
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/dsc`
63
-        )
64
-        .then(result => {
65
-          commit("setDescription", result.data);
66
-        })
67
-        .catch(console.error);
68
-    },
69
-    getResort({ commit }, resortCode) {
70
-      axios
71
-        .get(
72
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/TRESORT/${resortCode}`
73
-        )
74
-        .then(result => {
75
-          commit("setResort", result.data);
76
-          console.log(result.data);
77
-        })
78
-        .catch(console.error);
79
-    },
80
-    async getImage1({ commit }, resortCode) {
81
-      return axios
82
-        .get(
83
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/image/1`
84
-        )
85
-        .then(result => {
86
-          commit("addImage", result.data);
87
-          return Promise.resolve(result.data);
88
-        })
89
-        .catch(console.error);
90
-    },
91
-    getImage2({ commit }, resortCode) {
92
-      axios
93
-        .get(
94
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/image/2`
95
-        )
96
-        .then(result => commit("addImage", result.data))
97
-        .catch(console.error);
98
-    },
99
-    getImage3({ commit }, resortCode) {
100
-      axios
101
-        .get(
102
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/image/3`
103
-        )
104
-        .then(result => commit("addImage", result.data))
105
-        .catch(console.error);
106
-    },
107
-    getImage4({ commit }, resortCode) {
108
-      axios
109
-        .get(
110
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/image/4`
111
-        )
112
-        .then(result => {
113
-          if (result.data && result.data.length > 0) {
114
-            commit("addImage", result.data);
115
-          }
116
-        })
117
-        .catch(console.error);
118
-    },
119
-    getImage5({ commit }, resortCode) {
120
-      axios
121
-        .get(
122
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/image/5`
123
-        )
124
-        .then(result => {
125
-          if (result.data && result.data.length > 0) {
126
-            commit("addImage", result.data);
127
-          }
128
-        })
129
-        .catch(console.error);
130
-    },
131
-    getLayout({ commit }, resortCode) {
132
-      axios
133
-        .get(
134
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${resortCode}/layout`
135
-        )
136
-        .then(result => commit("setLayout", result.data))
137
-        .catch(console.error);
138
-    },
139
-    getResorts({ commit }, regionCode) {
140
-      return new Promise((resolve, reject) => {
141
-        axios
142
-          .get(`/api/resort/${regionCode}`)
143
-          .then(result => {
144
-            commit("setResorts", result.data);
145
-            resolve();
146
-          })
147
-          .catch(error => reject(new Error(error.message)));
148
-      });
149
-    },
150
-    getResortMedia({ commit }, resortCode) {
151
-      axios
152
-        .get(
153
-          `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/social/${resortCode}`
154
-        )
155
-        .then(result => commit("setResortMedia", result.data));
156
-    },
157
-    async getResortData({ commit }, resortCode) {
158
-      await axios
159
-        .get(`/api/resort/GetResortData/${resortCode}`)
160
-        .then(result => {
161
-          commit("setResort", result.data);
162
-        })
163
-        .catch(error => console.log(new Error(error.message)));
164
-    },
165
-    async getResortWithListings({commit}, resortCode){
166
-      await axios.get("/api/resort/GetPublishedResortsWithListings").then(result => {
167
-        commit("setResortsWithListings", result.data)
168
-      })
169
-    }
170
-  }
171
-};
8
+    namespaced: true,
9
+    state: {
10
+        resorts: [],
11
+        resort: {},
12
+        images: [],
13
+        layout: '',
14
+        description: '',
15
+        resortMedia: undefined,
16
+        resortsWithListings: [],
17
+    },
18
+    mutations: {
19
+        setResort(state, resort) {
20
+            state.resort = resort
21
+        },
22
+        setDescription(state, description) {
23
+            state.description = description
24
+        },
25
+        addImage(state, image) {
26
+            state.images.push(`data:image/jpeg;base64,${image}`)
27
+        },
28
+        clear(state) {
29
+            state.resort = {}
30
+            state.images = []
31
+            state.layout = ''
32
+        },
33
+        setLayout(state, image) {
34
+            state.layout = `data:image/jpeg;base64,${image}`
35
+        },
36
+        setResorts(state, list) {
37
+            state.resorts = list
38
+        },
39
+        setResortMedia(state, media) {
40
+            state.resortMedia = media
41
+        },
42
+        setResortsWithListings(state, data) {
43
+            state.resortsWithListings = data
44
+        },
45
+    },
46
+    getters: {},
47
+    actions: {
48
+        async initResort({ commit, dispatch }, id) {
49
+            commit('clear')
50
+            await dispatch('getResort', id)
51
+            dispatch('getDescription', id)
52
+            dispatch('getImage1', id)
53
+            dispatch('getImage2', id)
54
+            dispatch('getImage3', id)
55
+            dispatch('getImage4', id)
56
+            dispatch('getImage5', id)
57
+            dispatch('getLayout', id)
58
+        },
59
+        getDescription({ commit }, id) {
60
+            axios
61
+                .get(
62
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/dsc`,
63
+                )
64
+                .then((result) => {
65
+                    commit('setDescription', result.data)
66
+                })
67
+                .catch(console.error)
68
+        },
69
+        getResort({ commit }, id) {
70
+            axios
71
+                .get(
72
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/TRESORT/${id}`,
73
+                )
74
+                .then((result) => {
75
+                    commit('setResort', result.data)
76
+                    console.log(result.data)
77
+                })
78
+                .catch(console.error)
79
+        },
80
+        async getImage1({ commit }, id) {
81
+            return axios
82
+                .get(
83
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/image/0`,
84
+                )
85
+                .then((result) => {
86
+                    commit('addImage', result.data)
87
+                    return Promise.resolve(result.data)
88
+                })
89
+                .catch(console.error)
90
+        },
91
+        getImage2({ commit }, id) {
92
+            axios
93
+                .get(
94
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/image/1`,
95
+                )
96
+                .then((result) => commit('addImage', result.data))
97
+                .catch(console.error)
98
+        },
99
+        getImage3({ commit }, id) {
100
+            axios
101
+                .get(
102
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/image/2`,
103
+                )
104
+                .then((result) => commit('addImage', result.data))
105
+                .catch(console.error)
106
+        },
107
+        getImage4({ commit }, id) {
108
+            axios
109
+                .get(
110
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/image/3`,
111
+                )
112
+                .then((result) => {
113
+                    if (result.data && result.data.length > 0) {
114
+                        commit('addImage', result.data)
115
+                    }
116
+                })
117
+                .catch(console.error)
118
+        },
119
+        getImage5({ commit }, id) {
120
+            axios
121
+                .get(
122
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/image/4`,
123
+                )
124
+                .then((result) => {
125
+                    if (result.data && result.data.length > 0) {
126
+                        commit('addImage', result.data)
127
+                    }
128
+                })
129
+                .catch(console.error)
130
+        },
131
+        getLayout({ commit }, id) {
132
+            axios
133
+                .get(
134
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${id}/layout`,
135
+                )
136
+                .then((result) => commit('setLayout', result.data))
137
+                .catch(console.error)
138
+        },
139
+        getResorts({ commit }, regionCode) {
140
+            return new Promise((resolve, reject) => {
141
+                axios
142
+                    .get(`/api/resort/${regionCode}`)
143
+                    .then((result) => {
144
+                        commit('setResorts', result.data)
145
+                        resolve()
146
+                    })
147
+                    .catch((error) => reject(new Error(error.message)))
148
+            })
149
+        },
150
+        getResortMedia({ commit }, id) {
151
+            axios
152
+                .get(
153
+                    `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/social/${id}`,
154
+                )
155
+                .then((result) => commit('setResortMedia', result.data))
156
+        },
157
+        async getResortData({ commit }, id) {
158
+            await axios
159
+                .get(`/api/resort/GetResortData/${id}`)
160
+                .then((result) => {
161
+                    commit('setResort', result.data)
162
+                })
163
+                .catch((error) => console.log(new Error(error.message)))
164
+        },
165
+        async getResortWithListings({ commit }, id) {
166
+            await axios
167
+                .get('/api/resort/GetPublishedResortsWithListings')
168
+                .then((result) => {
169
+                    commit('setResortsWithListings', result.data)
170
+                })
171
+        },
172
+    },
173
+}

+ 200
- 176
src/store/modules/timeshare/weekList.js Прегледај датотеку

@@ -3,187 +3,211 @@
3 3
 /* eslint-disable no-restricted-syntax */
4 4
 /* eslint-disable guard-for-in */
5 5
 /* eslint-disable */
6
-import axios from "axios";
7
-import _, { min } from "lodash";
6
+import axios from 'axios'
7
+import _, { min } from 'lodash'
8 8
 
9 9
 export default {
10
-  namespaced: true,
11
-  state: {
12
-    weeks: [],
13
-    status: undefined,
14
-    filter: {
15
-      season: undefined,
16
-      status: undefined,
17
-      region: undefined,
18
-      resort: undefined,
19
-      bedrooms: undefined,
20
-      date: undefined,
21
-      ddate: undefined,
22
-      minPrice: undefined,
23
-      maxPrice: undefined,
24
-      keyword: undefined
10
+    namespaced: true,
11
+    state: {
12
+        weeks: [],
13
+        status: undefined,
14
+        filter: {
15
+            season: undefined,
16
+            status: undefined,
17
+            region: undefined,
18
+            resort: undefined,
19
+            bedrooms: undefined,
20
+            date: undefined,
21
+            ddate: undefined,
22
+            minPrice: undefined,
23
+            maxPrice: undefined,
24
+            keyword: undefined,
25
+        },
26
+        prevFilter: undefined,
27
+        difFilter: undefined,
28
+        searchParams: {
29
+            region: undefined,
30
+            resort: undefined,
31
+            regionObj: undefined,
32
+        },
25 33
     },
26
-    prevFilter: undefined,
27
-    difFilter: undefined,
28
-    searchParams: {
29
-      region: undefined,
30
-      resort: undefined,
31
-      regionObj: undefined
32
-    }
33
-  },
34
-  mutations: {
35
-    onLoading(state) {
36
-      state.status = "Loading...";
34
+    mutations: {
35
+        onLoading(state) {
36
+            state.status = 'Loading...'
37
+        },
38
+        onError(state) {
39
+            state.status = 'Error occurred getting data.'
40
+        },
41
+        onClearFilter(state, filter) {
42
+            state.filter[filter] = undefined
43
+        },
44
+        setWeeks(state, weeks) {
45
+            state.weeks = weeks
46
+            state.status = ''
47
+        },
48
+        addWeek(state, week) {
49
+            state.weeks.push(week)
50
+        },
51
+        applyResort(state, resort) {
52
+            state.filter.resort = resort
53
+        },
37 54
     },
38
-    onError(state) {
39
-      state.status = "Error occurred getting data.";
40
-    },
41
-    onClearFilter(state, filter) {
42
-      state.filter[filter] = undefined;
43
-    },
44
-    setWeeks(state, weeks) {
45
-      state.weeks = weeks;
46
-      state.status = "";
47
-    },
48
-    addWeek(state, week) {
49
-      state.weeks.push(week);
50
-    },
51
-    applyResort(state, resort) {
52
-      state.filter.resort = resort;
53
-    }
54
-  },
55
-  getters: {
56
-    filteredWeeks: state => {
57
-      let weekList = state.weeks;
58
-      const { filter } = state;
59
-      if (filter) {
60
-        if (filter.keyword) {
61
-          const list = [];
62
-          for (const i in weekList) {
63
-            const item = weekList[i];
64
-            for (const r in item) {
65
-              const innerItem = item[r];
66
-              if (
67
-                innerItem &&
68
-                JSON.stringify(innerItem)
69
-                  .toLowerCase()
70
-                  .includes(filter.keyword.toLowerCase())
71
-              ) {
72
-                list.push(item);
73
-                break;
74
-              }
55
+    getters: {
56
+        filteredWeeks: (state) => {
57
+            let weekList = state.weeks
58
+            const { filter } = state
59
+            if (filter) {
60
+                if (filter.keyword) {
61
+                    const list = []
62
+                    for (const i in weekList) {
63
+                        const item = weekList[i]
64
+                        for (const r in item) {
65
+                            const innerItem = item[r]
66
+                            if (
67
+                                innerItem &&
68
+                                JSON.stringify(innerItem)
69
+                                .toLowerCase()
70
+                                .includes(filter.keyword.toLowerCase())
71
+                            ) {
72
+                                list.push(item)
73
+                                break
74
+                            }
75
+                        }
76
+                    }
77
+                    weekList = list
78
+                }
79
+                if (filter.region) {
80
+                    weekList = _.filter(
81
+                        weekList,
82
+                        (x) => x.region && x.region.regionCode === filter.region.regionCode,
83
+                    )
84
+                }
85
+                if (filter.resort) {
86
+                    weekList = _.filter(
87
+                        weekList,
88
+                        (x) =>
89
+                        x.resort.resortCode &&
90
+                        x.resort.resortCode === filter.resort.resortCode,
91
+                    )
92
+                }
93
+                if (filter.bedrooms) {
94
+                    if (filter.bedrooms === 'Studio') {
95
+                        weekList = _.filter(
96
+                            weekList,
97
+                            (x) => (x.bedrooms && x.bedrooms === '0') || !x.bedrooms,
98
+                        )
99
+                    } else {
100
+                        weekList = _.filter(
101
+                            weekList,
102
+                            (x) => x.bedrooms && x.bedrooms === filter.bedrooms,
103
+                        )
104
+                    }
105
+                }
106
+                if (filter.date) {
107
+                    const minDate = new Date(filter.date)
108
+                    minDate.setDate(minDate.getDate() - 1)
109
+                    weekList = _.filter(
110
+                        weekList,
111
+                        (x) => new Date(x.arrivalDate) >= minDate,
112
+                    )
113
+                }
114
+                if (filter.ddate) {
115
+                    const maxDate = new Date(filter.ddate)
116
+                    weekList = _.filter(
117
+                        weekList,
118
+                        (x) => new Date(x.departureDate) <= maxDate,
119
+                    )
120
+                }
121
+                if (filter.minPrice && filter.minPrice !== 0) {
122
+                    weekList = _.filter(
123
+                        weekList,
124
+                        (x) => x.sellPrice && x.sellPrice >= filter.minPrice,
125
+                    )
126
+                }
127
+                if (filter.maxPrice && filter.maxPrice !== 0) {
128
+                    weekList = _.filter(
129
+                        weekList,
130
+                        (x) => x.sellPrice && x.sellPrice <= filter.maxPrice,
131
+                    )
132
+                }
133
+                if (filter.season) {
134
+                    weekList = _.filter(weekList, (x) => x.season === filter.season.name)
135
+                }
75 136
             }
76
-          }
77
-          weekList = list;
78
-        }
79
-        if (filter.region) {
80
-          weekList = _.filter(
81
-            weekList,
82
-            x => x.region && x.region.regionCode === filter.region.regionCode
83
-          );
84
-        }
85
-        if (filter.resort) {
86
-          weekList = _.filter(
87
-            weekList,
88
-            x => x.resort.resortCode && x.resort.resortCode === filter.resort.resortCode
89
-          );
90
-        }
91
-        if (filter.bedrooms) {
92
-          if (filter.bedrooms === "Studio") {
93
-            weekList = _.filter(weekList, x => (x.bedrooms && x.bedrooms === "0") || !x.bedrooms);
94
-          } else {
95
-            weekList = _.filter(weekList, x => x.bedrooms && x.bedrooms === filter.bedrooms);
96
-          }
97
-        }
98
-        if (filter.date) {
99
-          const minDate = new Date(filter.date);
100
-          minDate.setDate(minDate.getDate() - 1);
101
-          weekList = _.filter(weekList, x => new Date(x.arrivalDate) >= minDate);
102
-        }
103
-        if (filter.ddate) {
104
-          const maxDate = new Date(filter.ddate);
105
-          weekList = _.filter(weekList, x => new Date(x.departureDate) <= maxDate);
106
-        }
107
-        if (filter.minPrice && filter.minPrice !== 0) {
108
-          weekList = _.filter(weekList, x => x.sellPrice && x.sellPrice >= filter.minPrice);
109
-        }
110
-        if (filter.maxPrice && filter.maxPrice !== 0) {
111
-          weekList = _.filter(weekList, x => x.sellPrice && x.sellPrice <= filter.maxPrice);
112
-        }
113
-        if (filter.season) {
114
-          weekList = _.filter(weekList, x => x.season === filter.season.name);
115
-        }
116
-      }
117
-      return _.sortBy(_.sortBy(weekList, "arrivalDate"), "resort.resortName");
118
-    },
119
-    getRegions(state, getters, rootState, rootGetters) {
120
-      return rootGetters["timeshare/getRegionCode"]("KK");
121
-    },
122
-    weekById(state) {
123
-      return (resortCode, unitNumber) => {
124
-        const w = state.weeks.find(
125
-          week =>
126
-            week.resort !== undefined &&
127
-            week.resort.resortCode === resortCode &&
128
-            week.unitNumber === unitNumber
129
-        );
130
-        console.log(resortCode, unitNumber);
137
+            return _.sortBy(_.sortBy(weekList, 'arrivalDate'), 'resort.resortName')
138
+        },
139
+        getRegions(state, getters, rootState, rootGetters) {
140
+            return rootGetters['timeshare/getRegionCode']('KK')
141
+        },
142
+        weekById(state) {
143
+            return (resortCode, unitNumber) => {
144
+                const w = state.weeks.find(
145
+                    (week) =>
146
+                    week.resort !== undefined &&
147
+                    week.resort.resortCode === resortCode &&
148
+                    week.unitNumber === unitNumber,
149
+                )
150
+                console.log(resortCode, unitNumber)
131 151
 
132
-        if (w) {
133
-          return w;
134
-        }
135
-      };
136
-    }
137
-  },
138
-  actions: {
139
-    applyResortFilter({ commit }, resortCode) {
140
-      commit("applyResort", {
141
-        resortCode
142
-      });
143
-    },
144
-    async getByResortCode({ commit }, resortCode) {
145
-      commit("onLoading");
146
-      await axios.get("/api/timeshareweek/getByResortCode/" + resortCode).then(result => {
147
-        commit("setWeeks", result.data);
148
-        console.log(result);
149
-      });
150
-    },
151
-    async getWeeks({ commit, rootGetters }) {
152
-      //commit("onLoading");
153
-      await axios
154
-        .get("/api/timeshareweek")
155
-        .then(result => {
156
-          const arr2 = result.data.filter(x => x.region !== null);
157
-          console.log(arr2);
158
-          const arr3 = result.data.filter(x => x.region === null);
159
-          for (const item in arr3) {
160
-            const myItem = arr3[item];
161
-            if (myItem !== undefined) {
162
-              const code = myItem.resort.resortCode;
163
-              myItem.region = {
164
-                regionName: rootGetters["timeshare/getRegionCode"](code)
165
-              };
166
-              myItem.resort = {
167
-                resortName: rootGetters["timeshare/getResortName"](code),
168
-                resortCode: code
169
-              };
152
+                if (w) {
153
+                    return w
154
+                }
170 155
             }
171
-          }
172
-          console.log(arr3);
173
-          commit("setWeeks", arr2);
174
-        })
175
-        .catch(console.error);
156
+        },
157
+    },
158
+    actions: {
159
+        applyResortFilter({ commit }, resortCode) {
160
+            commit('applyResort', {
161
+                resortCode,
162
+            })
163
+        },
164
+        async getByResortCode({ commit }, resortCode) {
165
+            commit('onLoading')
166
+            await axios
167
+                .get('/api/timeshareweek/getByResortCode/' + resortCode)
168
+                .then((result) => {
169
+                    commit('setWeeks', result.data)
170
+                    console.log(result)
171
+                })
172
+        },
173
+        async getWeeks({ commit, rootGetters }) {
174
+            //commit("onLoading");
175
+            await axios
176
+                .get('/api/timeshareweek')
177
+                .then((result) => {
178
+                    const arr2 = result.data.filter((x) => x.region !== null)
179
+                        //console.log(arr2)
180
+                    const arr3 = result.data.filter((x) => x.region === null)
181
+                    for (const item in arr3) {
182
+                        const myItem = arr3[item]
183
+                        if (myItem !== undefined) {
184
+                            const code = myItem.resort.resortCode
185
+                            myItem.region = {
186
+                                regionName: rootGetters['timeshare/getRegionCode'](code),
187
+                            }
188
+                            myItem.resort = {
189
+                                resortName: rootGetters['timeshare/getResortName'](code),
190
+                                resortCode: code,
191
+                            }
192
+                        }
193
+                    }
194
+
195
+                    console.log(code)
196
+                        //console.log(arr3)
197
+                    commit('setWeeks', arr2)
198
+                })
199
+                .catch(console.error)
200
+        },
201
+        // getWeeks({ commit }) {
202
+        //   axios.get("api/timeshareweek").then(result =>
203
+        //     commit(
204
+        //       "setWeeks",
205
+        //       result.data.filter(x => x.region !== null)
206
+        //     )
207
+        //   );
208
+        // },
209
+        clearFilter({ commit }, filter) {
210
+            commit('onClearFilter', filter)
211
+        },
176 212
     },
177
-    // getWeeks({ commit }) {
178
-    //   axios.get("api/timeshareweek").then(result =>
179
-    //     commit(
180
-    //       "setWeeks",
181
-    //       result.data.filter(x => x.region !== null)
182
-    //     )
183
-    //   );
184
-    // },
185
-    clearFilter({ commit }, filter) {
186
-      commit("onClearFilter", filter);
187
-    }
188
-  }
189
-};
213
+}

+ 91
- 90
src/store/modules/user/authentication.js Прегледај датотеку

@@ -1,98 +1,99 @@
1 1
 /* eslint-disable */
2
-import Vue from "vue";
3
-import Vuex from "vuex";
4
-import axios from "axios";
5
-import log from "../../../assets/Log";
2
+import Vue from 'vue'
3
+import Vuex from 'vuex'
4
+import axios from 'axios'
5
+import log from '../../../assets/Log'
6 6
 
7
-Vue.use(Vuex);
7
+Vue.use(Vuex)
8 8
 export default {
9
-  namespaced: true,
10
-  state: {
11
-    isLoggedIn: log.isLoggedIn(),
12
-    flag: false,
13
-    status: undefined,
14
-    token: undefined,
15
-    user: undefined,
16
-    person: undefined,
17
-    agency: undefined
18
-  },
19
-  mutations: {
20
-    auth_request(state) {
21
-      state.status = "loading";
9
+    namespaced: true,
10
+    state: {
11
+        isLoggedIn: log.isLoggedIn(),
12
+        flag: false,
13
+        status: '',
14
+        token: undefined,
15
+        user: undefined,
16
+        person: undefined,
17
+        agency: undefined,
22 18
     },
23
-    auth_success(state, user) {
24
-      state.status = "success";
25
-      state.token = user.token;
26
-      state.user = user.user;
27
-      state.person = user.person;
28
-      state.agency = user.agency;
29
-    },
30
-    auth_error(state) {
31
-      state.status = "error";
32
-    },
33
-    logout(state) {
34
-      state.status = undefined;
35
-      state.token = undefined;
36
-      state.person = undefined;
37
-      state.agency = undefined;
38
-      state.user = undefined;
39
-    },
40
-    runInit(state, item) {
41
-      state.flag = true;
42
-      state.user = item.user;
43
-      state.token = item.token;
44
-      state.person = item.person;
45
-      state.agency = item.agency;
19
+    mutations: {
20
+        auth_request(state) {
21
+            state.status = 'loading'
22
+        },
23
+        auth_success(state, user) {
24
+            state.status = 'success'
25
+            state.token = user.token
26
+            state.user = user.user
27
+            state.person = user.person
28
+            state.agency = user.agency
29
+        },
30
+        auth_error(state) {
31
+            state.status = 'error'
32
+        },
33
+        logout(state) {
34
+            state.status = ''
35
+            state.token = undefined
36
+            state.person = undefined
37
+            state.agency = undefined
38
+            state.user = undefined
39
+        },
40
+        runInit(state, item) {
41
+            state.flag = true
42
+            state.user = item.user
43
+            state.token = item.token
44
+            state.person = item.person
45
+            state.agency = item.agency
46
+        },
47
+        updateFlag(state) {
48
+            state.flag = true
49
+        },
46 50
     },
47
-    updateFlag(state) {
48
-      state.flag = true;
49
-    }
50
-  },
51
-  getters: {
52
-    authStatus: state => state.status,
53
-    getPerson: () => log.getPerson(),
54
-    getUser: () => log.getUser()
55
-  },
56
-  actions: {
57
-    init({ commit }) {
58
-      if (!log.isLoggedIn() && log.tokenExpired) {
59
-        log.clearValues();
60
-      } else log.updateTokenExpiry();
61
-      commit("runInit", {
62
-        user: log.getJSONObject("user"),
63
-        token: log.getJSONObject("token"),
64
-        person: log.getJSONObject("person"),
65
-        agency: log.getJSONObject("agency")
66
-      });
51
+    getters: {
52
+        authStatus: (state) => state.status,
53
+        getPerson: () => log.getPerson(),
54
+        getUser: () => log.getUser(),
67 55
     },
68
-    async login({ commit }, user) {
69
-      await axios({
70
-        url: "/api/register/authenticate",
71
-        data: {
72
-          username: user.username,
73
-          password: user.password
56
+    actions: {
57
+        init({ commit }) {
58
+            if (!log.isLoggedIn() && log.tokenExpired) {
59
+                log.clearValues()
60
+            } else log.updateTokenExpiry()
61
+            commit('runInit', {
62
+                user: log.getJSONObject('user'),
63
+                token: log.getJSONObject('token'),
64
+                person: log.getJSONObject('person'),
65
+                agency: log.getJSONObject('agency'),
66
+            })
67
+        },
68
+        async login({ commit }, user) {
69
+            await axios({
70
+                    url: '/api/register/authenticate',
71
+                    data: {
72
+                        username: user.username,
73
+                        password: user.password,
74
+                    },
75
+                    method: 'POST',
76
+                })
77
+                .then((resp) => {
78
+                    log.clearValues()
79
+                    log.setValues(resp.data)
80
+                    commit('auth_success', resp.data)
81
+                    return Promise.resolve()
82
+                })
83
+                .catch((ex) => {
84
+                    commit('auth_error')
85
+                    log.clearValues()
86
+                    commit('auth_error', 'error occurred')
87
+                    console.log(Promise.reject(ex.response));
88
+                    return Promise.reject(ex.response)
89
+                })
90
+        },
91
+        logout({ commit }) {
92
+            return new Promise(() => {
93
+                commit('logout')
94
+                log.clearValues()
95
+                delete axios.defaults.headers.common.Authorization
96
+            })
74 97
         },
75
-        method: "POST"
76
-      }).then((resp) => {
77
-        log.clearValues();
78
-        log.setValues(resp.data);
79
-        commit("auth_success", resp.data);
80
-        return Promise.resolve();
81
-      })
82
-      .catch((ex) => {        
83
-        commit("auth_error");
84
-        log.clearValues();
85
-        commit("auth_error", "error occurred");
86
-        return Promise.reject(ex.response);
87
-      })
88
-      
89 98
     },
90
-    logout({ commit }) {
91
-      return new Promise(() => {
92
-        commit("logout");
93
-        log.clearValues();
94
-        delete axios.defaults.headers.common.Authorization;
95
-      });
96
-    }
97
-  }
98
-};
99
+}

+ 53
- 55
src/store/modules/user/individual.js Прегледај датотеку

@@ -1,61 +1,59 @@
1
-/* eslint-disable no-restricted-syntax */
2
-/* eslint-disable guard-for-in */
3
-import axios from "axios";
1
+/* eslint-disable */
2
+import axios from 'axios'
4 3
 
5 4
 export default {
6
-  namespaced: true,
7
-  state: {
8
-    items: [],
9
-    indiv: undefined
10
-  },
11
-  mutations: {
12
-    addItem(state, item) {
13
-      state[item.name].push(item.value);
5
+    namespaced: true,
6
+    state: {
7
+        items: [],
8
+        indiv: undefined,
14 9
     },
15
-    setItem(state, item) {
16
-      state[item.name] = item.value;
17
-    }
18
-  },
19
-  getters: {},
20
-  actions: {
21
-    async getIndividual({ commit, rootGetters }, userId) {
22
-      let id = 0;
23
-      if (!userId || userId === 0) {
24
-        const rootItem = rootGetters["authentication/getUser"];
25
-        id = rootItem ? rootItem.id : 0;
26
-      } else id = userId;
27
-
28
-      if (!id) {
29
-        id = 0;
30
-      }
10
+    mutations: {
11
+        addItem(state, item) {
12
+            state[item.name].push(item.value)
13
+        },
14
+        setItem(state, item) {
15
+            state[item.name] = item.value
16
+        },
17
+    },
18
+    getters: {},
19
+    actions: {
20
+        async getIndividual({ commit, rootGetters }, userId) {
21
+            let id = 0
22
+            if (!userId || userId === 0) {
23
+                const rootItem = rootGetters['authentication/getUser']
24
+                id = rootItem ? rootItem.id : 0
25
+            } else id = userId
31 26
 
27
+            if (!id) {
28
+                id = 0
29
+            }
32 30
 
33
-      await axios
34
-        .get(`/api/individual/getIndividual/${id}`)
35
-        .then(r => {
36
-          commit("setItem", {
37
-            name: "indiv",
38
-            value: r.data
39
-          });
40
-        })
41
-        .catch(console.error);
42
-    },
43
-    getAllIndividuals({ commit }) {
44
-      axios
45
-        .get("/api/individual/getAllIndividuals")
46
-        .then(x => {
47
-          commit("setItem", {
48
-            name: "items",
49
-            value: x.data
50
-          });
51
-        })
52
-        .catch(console.error);
31
+            await axios
32
+                .get(`/api/individual/getIndividual/${id}`)
33
+                .then((r) => {
34
+                    commit('setItem', {
35
+                        name: 'indiv',
36
+                        value: r.data,
37
+                    })
38
+                })
39
+                .catch(console.error)
40
+        },
41
+        getAllIndividuals({ commit }) {
42
+            axios
43
+                .get('/api/individual/getAllIndividuals')
44
+                .then((x) => {
45
+                    commit('setItem', {
46
+                        name: 'items',
47
+                        value: x.data,
48
+                    })
49
+                })
50
+                .catch(console.error)
51
+        },
52
+        async updateIndividual({ commit }, item) {
53
+            await axios
54
+                .put('/api/individual', item)
55
+                .then((result) => commit('setItem', item))
56
+                .catch(console.error)
57
+        },
53 58
     },
54
-    async updateIndividual({ commit }, item) {
55
-      await axios
56
-        .put("/api/individual", item)
57
-        .then(result => commit("setItem", item))
58
-        .catch(console.error);
59
-    }
60
-  }
61
-};
59
+}

+ 24
- 23
src/store/modules/user/nonRegIndividual.js Прегледај датотеку

@@ -1,27 +1,28 @@
1 1
 /* eslint-disable */
2
-import axios from 'axios';
2
+import axios from 'axios'
3 3
 
4 4
 export default {
5
-  namespaced: true,
6
-  state: {
7
-    nonRegIndiv: [],
8
-  },
9
-  mutations: {
10
-    getIndiv(state, indiv) {
11
-      state.nonRegIndiv = indiv;
5
+    namespaced: true,
6
+    state: {
7
+        nonRegIndiv: [],
12 8
     },
13
-  },
14
-  getters: {
15
-    getIndiv: (state) => state.nonRegIndiv
16
-  },
17
-  actions: {
18
-    async retrieveNonRegIndiv({commit}, id){
19
-        console.log('twas here');
20
-        await axios.get('/api/nonRegIndividual/' + id)
21
-        .then((result) => {
22
-            commit('getIndiv', result.data)
23
-        })
24
-        .catch((e) => console.log(e))
25
-    }
26
-  },
27
-};
9
+    mutations: {
10
+        getIndiv(state, indiv) {
11
+            state.nonRegIndiv = indiv
12
+        },
13
+    },
14
+    getters: {
15
+        getIndiv: (state) => state.nonRegIndiv,
16
+    },
17
+    actions: {
18
+        async retrieveNonRegIndiv({ commit }, id) {
19
+            console.log('twas here')
20
+            await axios
21
+                .get('/api/nonRegIndividual/' + id)
22
+                .then((result) => {
23
+                    commit('getIndiv', result.data)
24
+                })
25
+                .catch((e) => console.log(e))
26
+        },
27
+    },
28
+}

+ 233
- 228
src/store/modules/user/register.js Прегледај датотеку

@@ -1,232 +1,237 @@
1 1
 /* eslint-disable */
2
-import axios from "axios";
3
-import promise from "core-js/fn/promise";
2
+import axios from 'axios'
3
+import promise from 'core-js/fn/promise'
4 4
 
5 5
 export default {
6
-  namespaced: true,
7
-  state: {
8
-    individuals: [],
9
-    agents: [],
10
-    agent: {},
11
-    registerIndividual: {
12
-      name: "",
13
-      surname: "",
14
-      email: "",
15
-      cellNumber: "",
16
-      username: "",
17
-      password: "",
18
-      acceptedTerms: false
19
-    },
20
-    registerAgency: {
21
-      name: "",
22
-      eaabeffcNumber: "",
23
-      companyRegNumber: "",
24
-      user: {
25
-        name: "",
26
-        surname: "",
27
-        email: "",
28
-        cellNumber: "",
29
-        username: "",
30
-        password: "",
31
-        role: ""
32
-      }
33
-    }
34
-  },
35
-  mutations: {
36
-    setIndividual(state, type) {
37
-      state.registerIndividual = type;
38
-    },
39
-    setIndividuals(state, type) {
40
-      state.individuals = type;
41
-    },
42
-    setAgents(state, type) {
43
-      state.agents = type;
44
-    },
45
-    setSingleAgent(state, agent){
46
-      state.agent = agent
47
-    },
48
-    setAgency(state, type) {
49
-      state.registerAgency = type;
50
-    },
51
-    addIndividual(state, type) {
52
-      state.registerIndividual = type;
53
-    },
54
-    addAgency(state, type) {
55
-      state.registerAgency = type;
56
-    },
57
-    addAgent(state, type) {
58
-      state.registerIndividual = type;
59
-    },
60
-    updateIndividual(state, type) {
61
-      state.registerIndividual.find(item => item.id === type.id).username = type.username;
62
-      state.registerIndividual.find(item => item.id === type.id).password = type.password;
63
-    },
64
-    updateAgency(state, type) {
65
-      state.registerAgency.find(item => item.id === type.id).eaabeffcNumber = type.eaabeffcNumber;
66
-      state.registerAgency.find(item => item.id === type.id).companyRegNumber =
67
-        type.companyRegNumber;
68
-    },
69
-    clearIndividual(state) {
70
-      state.registerIndividual = {
71
-        name: "",
72
-        surname: "",
73
-        email: "",
74
-        cellNumber: "",
75
-        username: "",
76
-        password: "",
77
-        acceptedTerms: false
78
-      };
79
-    },
80
-    clearAgency(state) {
81
-      state.registerAgency = {
82
-        name: "",
83
-        eaabeffcNumber: "",
84
-        companyRegNumber: "",
85
-        user: {
86
-          name: "",
87
-          surname: "",
88
-          email: "",
89
-          cellNumber: "",
90
-          username: "",
91
-          password: ""
92
-        }
93
-      };
94
-    },
95
-    removeIndividual(state, id) {
96
-      var index = state.individuals.findIndex((indiv) => indiv.id === id)
97
-      state.individuals.splice(index, 1)
98
-    },
99
-    removeAgency(state, id) {
100
-      state.registerAgency.pop(state.registerAgency.find(a => a.id === id));
101
-    },
102
-    removeAgent(state, id) {
103
-      var index = state.agents.findIndex((agent) => agent.id === id)
104
-      state.agents.splice(index, 1)      
105
-    }
106
-  },
107
-  getters: {},
108
-  actions: {
109
-    async forgotPasswordCheck({commit}, mail){
110
-      await axios.post('api/register/forgotPassword/'+ mail).then((resp) => {
111
-        return Promise.resolve(resp.data)
112
-      })
113
-      .catch((ex) => {
114
-        console.log(ex.response);
115
-        return Promise.reject(ex.response)
116
-      })
117
-      // if(response.status === 200){
118
-      //   return Promise.resolve()
119
-      // }else{
120
-      //   console.log(response.response);
121
-      //   return Promise.reject()
122
-      // }
123
-    },
124
-    getIndividuals({ commit }) {
125
-      axios
126
-        .get("/api/individual")
127
-        .then(result => commit("setIndividuals", result.data))
128
-        .catch(console.error);
129
-    },
130
-    getAgents({ commit }) {
131
-      axios
132
-        .get("/api/agent")
133
-        .then(result => commit("setAgents", result.data))
134
-        .catch(console.error);
135
-    },
136
-    async getAgentById({commit}, userId){
137
-      await axios
138
-        .get('/api/agent/single/' +  userId)
139
-        .then((result) => {
140
-          console.log(result);
141
-          commit("setSingleAgent", result.data)
142
-        })
143
-        .catch((e) => {
144
-          console.log(e);
145
-        })
146
-    },
147
-    // getAgency({
148
-    //   commit,
149
-    // }, id) {
150
-    //   axios
151
-    //     .get(`/api/agency/${id}`)
152
-    //     .then(result => commit('setAgency', result.data))
153
-    //     .catch(console.error);
154
-    // },
6
+    namespaced: true,
7
+    state: {
8
+        individuals: [],
9
+        agents: [],
10
+        agent: {},
11
+        registerIndividual: {
12
+            name: '',
13
+            surname: '',
14
+            email: '',
15
+            cellNumber: '',
16
+            telephone: '',
17
+            username: '',
18
+            password: '',
19
+            acceptedTerms: false,
20
+        },
21
+        registerAgency: {
22
+            name: '',
23
+            eaabeffcNumber: '',
24
+            companyRegNumber: '',
25
+            user: {
26
+                name: '',
27
+                surname: '',
28
+                email: '',
29
+                cellNumber: '',
30
+                telephone: '',
31
+                username: '',
32
+                password: '',
33
+                role: '',
34
+            },
35
+        },
36
+    },
37
+    mutations: {
38
+        setIndividual(state, type) {
39
+            state.registerIndividual = type
40
+        },
41
+        setIndividuals(state, type) {
42
+            state.individuals = type
43
+        },
44
+        setAgents(state, type) {
45
+            state.agents = type
46
+        },
47
+        setSingleAgent(state, agent) {
48
+            state.agent = agent
49
+        },
50
+        setAgency(state, type) {
51
+            state.registerAgency = type
52
+        },
53
+        addIndividual(state, type) {
54
+            state.registerIndividual = type
55
+        },
56
+        addAgency(state, type) {
57
+            state.registerAgency = type
58
+        },
59
+        addAgent(state, type) {
60
+            state.registerIndividual = type
61
+        },
62
+        updateIndividual(state, type) {
63
+            state.registerIndividual.find((item) => item.id === type.id).username =
64
+                type.username
65
+            state.registerIndividual.find((item) => item.id === type.id).password =
66
+                type.password
67
+        },
68
+        updateAgency(state, type) {
69
+            state.registerAgency.find((item) => item.id === type.id).eaabeffcNumber =
70
+                type.eaabeffcNumber
71
+            state.registerAgency.find(
72
+                (item) => item.id === type.id,
73
+            ).companyRegNumber = type.companyRegNumber
74
+        },
75
+        clearIndividual(state) {
76
+            state.registerIndividual = {
77
+                name: '',
78
+                surname: '',
79
+                email: '',
80
+                cellNumber: '',
81
+                username: '',
82
+                password: '',
83
+                acceptedTerms: false,
84
+            }
85
+        },
86
+        clearAgency(state) {
87
+            state.registerAgency = {
88
+                name: '',
89
+                eaabeffcNumber: '',
90
+                companyRegNumber: '',
91
+                user: {
92
+                    name: '',
93
+                    surname: '',
94
+                    email: '',
95
+                    cellNumber: '',
96
+                    username: '',
97
+                    password: '',
98
+                },
99
+            }
100
+        },
101
+        removeIndividual(state, id) {
102
+            var index = state.individuals.findIndex((indiv) => indiv.id === id)
103
+            state.individuals.splice(index, 1)
104
+        },
105
+        removeAgency(state, id) {
106
+            state.registerAgency.pop(state.registerAgency.find((a) => a.id === id))
107
+        },
108
+        removeAgent(state, id) {
109
+            var index = state.agents.findIndex((agent) => agent.id === id)
110
+            state.agents.splice(index, 1)
111
+        },
112
+    },
113
+    getters: {},
114
+    actions: {
115
+        async forgotPasswordCheck({ commit }, mail) {
116
+            await axios
117
+                .post('api/register/forgotPassword/' + mail)
118
+                .then((resp) => {
119
+                    return Promise.resolve(resp.data)
120
+                })
121
+                .catch((ex) => {
122
+                    console.log(ex.response)
123
+                    return Promise.reject(ex.response)
124
+                })
125
+                // if(response.status === 200){
126
+                //   return Promise.resolve()
127
+                // }else{
128
+                //   console.log(response.response);
129
+                //   return Promise.reject()
130
+                // }
131
+        },
132
+        getIndividuals({ commit }) {
133
+            axios
134
+                .get('/api/individual')
135
+                .then((result) => commit('setIndividuals', result.data))
136
+                .catch(console.error)
137
+        },
138
+        getAgents({ commit }) {
139
+            axios
140
+                .get('/api/agent')
141
+                .then((result) => commit('setAgents', result.data))
142
+                .catch(console.error)
143
+        },
144
+        async getAgentById({ commit }, userId) {
145
+            await axios
146
+                .get('/api/agent/single/' + userId)
147
+                .then((result) => {
148
+                    console.log(result)
149
+                    commit('setSingleAgent', result.data)
150
+                })
151
+                .catch((e) => {
152
+                    console.log(e)
153
+                })
154
+        },
155
+        getAgency({ commit }, id) {
156
+            axios
157
+                .get(`/api/agency/${id}`)
158
+                .then((result) => commit('setAgency', result.data))
159
+                .catch(console.error)
160
+        },
155 161
 
156
-    async saveIndividual({ commit }, item) {
157
-      
158
-      await axios
159
-        .post("/api/register/register", item)
160
-        .then(res => {
161
-          commit("addIndividual", res.data);
162
-          return promise.resolve()
163
-        })
164
-        .catch((ex) => {
165
-          console.log(ex.response);
166
-          return promise.reject(ex.response)
167
-          //console.error;
168
-        });
169
-    },
170
-    saveAgency({ commit }, item) {
171
-      axios
172
-        .post("/api/register/registeragency", item)
173
-        .then(result => commit("addAgency", result.data))
174
-        .catch(ex => console.log(ex.response));
175
-    },
176
-    async saveAgent({ commit }, item) {
177
-      await axios
178
-        .post("/api/agent/AgentFromUser", item)
179
-        .then((res) => {
180
-          commit("addAgent", res.data)
181
-          return Promise.resolve(res)
182
-        })
183
-        .catch((ex) => {
184
-          return Promise.reject(ex.response)
185
-        });
186
-    },
187
-    async updateIndividual({ commit }, userParam) {
188
-      await axios
189
-        .put("/api/user/", userParam)
190
-        .then(result => console.log(result))
191
-        .catch(console.error);
192
-    },
193
-    // updateAgency({
194
-    //   commit,
195
-    // }, item) {
196
-    //   axios
197
-    //     .put('/api/agency', item)
198
-    //     .then(result => commit('updateAgency', item))
199
-    //     .catch(console.error);
200
-    // },
201
-    // clearIndividual({
202
-    //   commit,
203
-    // }) {
204
-    //   commit('clearIndividual');
205
-    // },
206
-    // clearAgency({
207
-    //   commit,
208
-    // }) {
209
-    //   commit('clearAgency');
210
-    // },
211
-    deleteIndividual({ commit }, id) {
212
-      axios
213
-        .delete(`/api/individual/${id}`)
214
-        .then(result => commit("removeIndividual", id))
215
-        .catch(console.error);
216
-    },
217
-    deleteAgent({ commit }, id) {
218
-      axios
219
-        .delete(`/api/agent/${id}`)
220
-        .then(result => commit("removeAgent", id))
221
-        .catch(ex => console.log(ex.response));
222
-    }
223
-    // deleteAgency({
224
-    //   commit,
225
-    // }, id) {
226
-    //   axios
227
-    //     .delete(`/api/agency/${id}`)
228
-    //     .then(result => commit('removeAgency', id))
229
-    //     .catch(console.error);
230
-    // },
231
-  }
232
-};
162
+        async saveIndividual({ commit }, item) {
163
+            await axios
164
+                .post('/api/register/register', item)
165
+                .then((res) => {
166
+                    commit('addIndividual', res.data)
167
+                    return promise.resolve()
168
+                })
169
+                .catch((ex) => {
170
+                    console.log(ex.response)
171
+                    return promise.reject(ex.response)
172
+                        //console.error;
173
+                })
174
+        },
175
+        saveAgency({ commit }, item) {
176
+            axios
177
+                .post('/api/register/registeragency', item)
178
+                .then((result) => commit('addAgency', result.data))
179
+                .catch((ex) => console.log(ex.response))
180
+        },
181
+        async saveAgent({ commit }, item) {
182
+            await axios
183
+                .post('/api/agent/AgentFromUser', item)
184
+                .then((res) => {
185
+                    commit('addAgent', res.data)
186
+                    return Promise.resolve(res)
187
+                })
188
+                .catch((ex) => {
189
+                    return Promise.reject(ex.response)
190
+                })
191
+        },
192
+        async updateIndividual({ commit }, userParam) {
193
+            await axios
194
+                .put('/api/user/', userParam)
195
+                .then((result) => console.log(result))
196
+                .catch(console.error)
197
+        },
198
+        // updateAgency({
199
+        //   commit,
200
+        // }, item) {
201
+        //   axios
202
+        //     .put('/api/agency', item)
203
+        //     .then(result => commit('updateAgency', item))
204
+        //     .catch(console.error);
205
+        // },
206
+        // clearIndividual({
207
+        //   commit,
208
+        // }) {
209
+        //   commit('clearIndividual');
210
+        // },
211
+        // clearAgency({
212
+        //   commit,
213
+        // }) {
214
+        //   commit('clearAgency');
215
+        // },
216
+        deleteIndividual({ commit }, id) {
217
+            axios
218
+                .delete(`/api/individual/${id}`)
219
+                .then((result) => commit('removeIndividual', id))
220
+                .catch(console.error)
221
+        },
222
+        deleteAgent({ commit }, id) {
223
+            axios
224
+                .delete(`/api/agent/${id}`)
225
+                .then((result) => commit('removeAgent', id))
226
+                .catch((ex) => console.log(ex.response))
227
+        },
228
+        // deleteAgency({
229
+        //   commit,
230
+        // }, id) {
231
+        //   axios
232
+        //     .delete(`/api/agency/${id}`)
233
+        //     .then(result => commit('removeAgency', id))
234
+        //     .catch(console.error);
235
+        // },
236
+    },
237
+}

+ 15
- 15
vue.config.js Прегледај датотеку

@@ -1,16 +1,16 @@
1 1
 module.exports = {
2
-  devServer: {
3
-    proxy: {
4
-      "/api": {
5
-        //target: "http://localhost:57260/",
6
-        target: "http://training.provision-sa.com:120/",
7
-        //target: "https://www.pvsl.co.za:86/",
8
-        changeOrigin: true
9
-      },
10
-      "/nph-srep": {
11
-        target: "http://www.unipoint-consoft.co.za",
12
-        changeOrigin: true
13
-      }
14
-    }
15
-  }
16
-};
2
+    devServer: {
3
+        proxy: {
4
+            '/api': {
5
+                target: 'http://localhost:57260/',
6
+                //target: "http://training.provision-sa.com:120/",
7
+                //target: "https://www.pvsl.co.za:86/",
8
+                changeOrigin: true,
9
+            },
10
+            '/nph-srep': {
11
+                target: 'http://www.unipoint-consoft.co.za',
12
+                changeOrigin: true,
13
+            },
14
+        },
15
+    },
16
+}

Loading…
Откажи
Сачувај