shared-ritm 1.2.136 → 1.2.138
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.
|
@@ -51,6 +51,9 @@ declare class UserService extends ApiService {
|
|
|
51
51
|
checkUserVectors(id: string): Promise<{
|
|
52
52
|
count: number;
|
|
53
53
|
}>;
|
|
54
|
+
checkArchiveUserVectors(id: string): Promise<{
|
|
55
|
+
count: number;
|
|
56
|
+
}>;
|
|
54
57
|
addUserVectors(formData: FormData): Promise<{
|
|
55
58
|
response: string;
|
|
56
59
|
}>;
|
package/package.json
CHANGED
|
@@ -90,6 +90,10 @@ class UserService extends ApiService {
|
|
|
90
90
|
return await this.get(`/user/get-vectors/${id}`)
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
|
|
94
|
+
return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
|
|
95
|
+
}
|
|
96
|
+
|
|
93
97
|
public async addUserVectors(formData: FormData): Promise<{ response: string }> {
|
|
94
98
|
return await this.post(`/user/add-vector`, formData, {
|
|
95
99
|
headers: { 'Content-Type': 'multipart/form-data' },
|
|
@@ -42,7 +42,7 @@ interface Props {
|
|
|
42
42
|
label?: string
|
|
43
43
|
modelValue?: string
|
|
44
44
|
rules?: ((val?: string | number | null) => boolean | string)[]
|
|
45
|
-
disableRuleDates?: string
|
|
45
|
+
disableRuleDates?: string | string[]
|
|
46
46
|
time?: boolean
|
|
47
47
|
noPastDates?: boolean
|
|
48
48
|
disabled?: boolean
|
|
@@ -74,10 +74,20 @@ const disablePastDates = (date: string) => {
|
|
|
74
74
|
|
|
75
75
|
const [year, month, day] = date.split('/')
|
|
76
76
|
const currentDate = new Date(Number(year), Number(month) - 1, Number(day))
|
|
77
|
+
currentDate.setHours(0, 0, 0, 0)
|
|
77
78
|
|
|
78
79
|
if (props.disableRuleDates) {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
if (Array.isArray(props.disableRuleDates)) {
|
|
81
|
+
const firstDate = props.disableRuleDates[0] ? new Date(props.disableRuleDates[0]) : null
|
|
82
|
+
firstDate?.setHours(0, 0, 0, 0)
|
|
83
|
+
const lastDate = props.disableRuleDates[1] ? new Date(props.disableRuleDates[1]) : null
|
|
84
|
+
lastDate?.setHours(0, 0, 0, 0)
|
|
85
|
+
|
|
86
|
+
return (!firstDate || currentDate >= firstDate) && (!lastDate || currentDate <= lastDate)
|
|
87
|
+
} else {
|
|
88
|
+
const firstDate = new Date(props.disableRuleDates)
|
|
89
|
+
return currentDate >= firstDate
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
|
|
83
93
|
const today = new Date()
|