@fy-/fws-vue 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ import { useUserStore } from "../../stores/user";
|
|
|
6
6
|
import { useRest } from "../../composables/rest";
|
|
7
7
|
import { useEventBus } from "../../composables/event-bus";
|
|
8
8
|
import { computed, reactive, watchEffect, ref } from "vue";
|
|
9
|
-
import { required } from "@vuelidate/validators";
|
|
9
|
+
import { required, maxLength } from "@vuelidate/validators";
|
|
10
10
|
import VuePictureCropper, { cropper } from "vue-picture-cropper";
|
|
11
11
|
import { Uploader } from "@fy-/fws-js";
|
|
12
12
|
|
|
@@ -62,7 +62,9 @@ const rules = {
|
|
|
62
62
|
required: required,
|
|
63
63
|
},
|
|
64
64
|
Gender: {},
|
|
65
|
-
Bio: {
|
|
65
|
+
Bio: {
|
|
66
|
+
maxLength: maxLength(800),
|
|
67
|
+
},
|
|
66
68
|
Birthdate: {},
|
|
67
69
|
PublicGender: {},
|
|
68
70
|
PublicBio: {},
|
|
@@ -81,9 +83,8 @@ const patchUser = async () => {
|
|
|
81
83
|
// @ts-ignore
|
|
82
84
|
data.Birthdate = new Date(birtdateAtUnixms).toISOString().split("T")[0];
|
|
83
85
|
} catch (e) {
|
|
84
|
-
const birtdateAtUnixms = new Date(birtdate).getTime();
|
|
85
86
|
// @ts-ignore
|
|
86
|
-
data.Birthdate =
|
|
87
|
+
data.Birthdate = data.Birthdate.toISOString().split("T")[0];
|
|
87
88
|
}
|
|
88
89
|
// @ts-ignore
|
|
89
90
|
const response = await rest("User/_Profile", "PATCH", data);
|
|
@@ -235,7 +236,7 @@ function selectFile(e: Event) {
|
|
|
235
236
|
id="bioFWS"
|
|
236
237
|
v-model="state.userData.Bio"
|
|
237
238
|
class="mb-4"
|
|
238
|
-
type="
|
|
239
|
+
type="textarea"
|
|
239
240
|
:label="$t('fws_bio_label')"
|
|
240
241
|
:error-vuelidate="v$.userData.Bio.$errors"
|
|
241
242
|
/>
|
|
@@ -24,9 +24,8 @@ const props = withDefaults(
|
|
|
24
24
|
const currentDate = new Date();
|
|
25
25
|
const defaultDate = new Date(
|
|
26
26
|
currentDate.setFullYear(currentDate.getFullYear() - 18),
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
.split("T")[0];
|
|
27
|
+
);
|
|
28
|
+
|
|
30
29
|
const ageValidator = (value: any) => {
|
|
31
30
|
const today = new Date();
|
|
32
31
|
const birthDate = new Date(value);
|
|
@@ -52,8 +51,6 @@ watchEffect(() => {
|
|
|
52
51
|
Gender: userData.value?.UserProfile?.Gender || "",
|
|
53
52
|
Birthdate: userData.value?.UserProfile?.Birthdate
|
|
54
53
|
? new Date(userData.value?.UserProfile?.Birthdate.unixms)
|
|
55
|
-
.toISOString()
|
|
56
|
-
.split("T")[0]
|
|
57
54
|
: defaultDate,
|
|
58
55
|
AcceptedTerms: userData.value?.AcceptedTerms || true,
|
|
59
56
|
};
|
|
@@ -93,9 +90,8 @@ const patchUser = async () => {
|
|
|
93
90
|
// @ts-ignore
|
|
94
91
|
data.Birthdate = new Date(birtdateAtUnixms).toISOString().split("T")[0];
|
|
95
92
|
} catch (e) {
|
|
96
|
-
const birtdateAtUnixms = new Date(birtdate).getTime();
|
|
97
93
|
// @ts-ignore
|
|
98
|
-
data.Birthdate =
|
|
94
|
+
data.Birthdate = data.Birthdate.toISOString().split("T")[0];
|
|
99
95
|
}
|
|
100
96
|
const response = await rest("User/_ForceProfile", "PATCH", data);
|
|
101
97
|
if (response && response.result == "success") {
|