@plusscommunities/pluss-core-web 1.6.13-beta.0 → 1.6.15-beta.0
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.
- package/package.json +1 -2
- package/rollup.config.js +45 -45
- package/src/actions/AuthActions.js +40 -40
- package/src/actions/LocalActions.js +5 -5
- package/src/actions/NavActions.js +5 -5
- package/src/actions/ScheduledActionsActions.js +5 -5
- package/src/actions/TemplateActions.js +9 -9
- package/src/actions/UsersActions.js +74 -70
- package/src/actions/index.js +6 -6
- package/src/actions/types.js +17 -17
- package/src/analytics.js +178 -158
- package/src/apis/analyticsActions.js +50 -50
- package/src/apis/authActions.js +55 -55
- package/src/apis/fileActions.js +147 -142
- package/src/apis/index.js +10 -10
- package/src/apis/profileActions.js +130 -130
- package/src/apis/scheduledActionsActions.js +9 -9
- package/src/apis/stringActions.js +26 -22
- package/src/apis/templateActions.js +38 -38
- package/src/apis/typeActions.js +183 -183
- package/src/apis/userActions.js +166 -166
- package/src/apis/utilityActions.js +32 -32
- package/src/colours.js +79 -77
- package/src/components/AddButton.js +29 -20
- package/src/components/AnalyticsFilter.js +136 -102
- package/src/components/Attachment.js +36 -22
- package/src/components/AudienceIncluder.js +209 -165
- package/src/components/AudienceSelector.js +680 -680
- package/src/components/Button.js +79 -56
- package/src/components/CheckBox.js +77 -65
- package/src/components/ColourOptions.js +205 -181
- package/src/components/ColourPicker.js +286 -244
- package/src/components/Comment.js +48 -39
- package/src/components/CommentSection.js +113 -103
- package/src/components/DatePicker.js +298 -255
- package/src/components/DropdownInput.js +236 -215
- package/src/components/DurationInput.js +46 -43
- package/src/components/ExportCsvPopup.js +236 -217
- package/src/components/FileInput.js +359 -346
- package/src/components/GenericInput.js +184 -153
- package/src/components/Header.js +88 -65
- package/src/components/HubSidebar.js +136 -124
- package/src/components/ImageInput.js +1182 -973
- package/src/components/InputGroup.js +20 -13
- package/src/components/MakerPopup.js +285 -278
- package/src/components/MoreMenu.js +21 -17
- package/src/components/OptionsSection.js +86 -74
- package/src/components/OverlayPage.js +61 -61
- package/src/components/OverlayPageBottomButtons.js +38 -38
- package/src/components/OverlayPageContents.js +38 -38
- package/src/components/OverlayPageSection.js +24 -24
- package/src/components/P60Icon.js +38 -33
- package/src/components/PageTitle.js +8 -8
- package/src/components/Popup.js +114 -95
- package/src/components/ProfilePic.js +40 -40
- package/src/components/RadioButton.js +142 -126
- package/src/components/Reactions.js +66 -66
- package/src/components/SVGIcon.js +31 -25
- package/src/components/SideNavItem.js +112 -83
- package/src/components/StatBox.js +54 -44
- package/src/components/StatusButton.js +31 -17
- package/src/components/SuccessPopup.js +61 -48
- package/src/components/Tabs.js +50 -47
- package/src/components/Tag.js +54 -54
- package/src/components/Text.js +18 -14
- package/src/components/TextFormatPopup.js +77 -49
- package/src/components/TimePicker.js +214 -200
- package/src/components/ToggleSwitch.js +60 -0
- package/src/components/UserListing.js +110 -97
- package/src/components/index.js +46 -46
- package/src/components/svg-icons.json +819 -819
- package/src/config.js +22 -22
- package/src/helper/HelpDeskWidget.js +4 -4
- package/src/helper/api/getUrl.js +16 -11
- package/src/helper/api/getUrlParams.js +8 -5
- package/src/helper/api/safeReadParams.js +3 -2
- package/src/helper/auth/getUserFromState.js +4 -4
- package/src/helper/colours/getAppColourFromState.js +10 -5
- package/src/helper/files/canvasImageUploader.js +152 -140
- package/src/helper/files/generateImageName.js +6 -6
- package/src/helper/files/get1400.js +33 -25
- package/src/helper/files/getExtension.js +5 -5
- package/src/helper/files/getFileName.js +9 -9
- package/src/helper/files/getThumb300.js +37 -29
- package/src/helper/files/isVideo.js +3 -3
- package/src/helper/helper.js +59 -56
- package/src/helper/index.js +29 -29
- package/src/helper/site/getMerchantsFromState.js +8 -4
- package/src/helper/site/getSiteLevelFromState.js +29 -29
- package/src/helper/site/getSiteName.js +11 -11
- package/src/helper/site/getSiteNameFromRoles.js +7 -7
- package/src/helper/site/getSiteSettingFromState.js +10 -5
- package/src/helper/storage/readJSONFromStorage.js +5 -5
- package/src/helper/storage/readStorageWithCookie.js +17 -17
- package/src/helper/storage/setLocalStorage.js +1 -1
- package/src/helper/strings/getFirstName.js +5 -5
- package/src/helper/strings/htmlDecode.js +2 -2
- package/src/helper/strings/htmlEncode.js +2 -2
- package/src/helper/strings/isEmail.js +7 -6
- package/src/helper/strings/isUrl.js +7 -7
- package/src/helper/strings/onlyAlphanumeric.js +4 -4
- package/src/helper/strings/randomString.js +6 -6
- package/src/helper/strings/toParagraphed.js +12 -12
- package/src/index.js +22 -11
- package/src/reducers/ScheduledActionsReducer.js +8 -8
- package/src/reducers/TemplatesReducer.js +22 -22
- package/src/reducers/index.js +4 -4
- package/src/session.js +70 -70
- package/src/urls.js +17 -16
- package/dist/index.cjs.js +0 -11623
- package/dist/index.esm.js +0 -11583
- package/dist/index.umd.js +0 -11595
package/src/analytics.js
CHANGED
|
@@ -1,183 +1,203 @@
|
|
|
1
|
-
import _ from
|
|
2
|
-
import moment from
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import moment from "moment";
|
|
3
3
|
|
|
4
4
|
export const compileStats = (stats) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
const totalStats = {};
|
|
6
|
+
Object.keys(stats).forEach((id) => {
|
|
7
|
+
Object.keys(stats[id]).forEach((activityId) => {
|
|
8
|
+
if (Array.isArray(stats[id][activityId])) {
|
|
9
|
+
if (!totalStats[activityId]) {
|
|
10
|
+
totalStats[activityId] = [];
|
|
11
|
+
}
|
|
12
|
+
Array.prototype.push.apply(
|
|
13
|
+
totalStats[activityId],
|
|
14
|
+
stats[id][activityId],
|
|
15
|
+
);
|
|
16
|
+
totalStats[activityId] = _.uniq(totalStats[activityId]);
|
|
17
|
+
} else {
|
|
18
|
+
if (!totalStats[activityId]) {
|
|
19
|
+
totalStats[activityId] = 0;
|
|
20
|
+
}
|
|
21
|
+
totalStats[activityId] += stats[id][activityId];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return totalStats;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
export const getInsight = (stats, previousStats, source, key, activity) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
let top = { Stats: { [activity]: 0 } };
|
|
30
|
+
Object.keys(stats).forEach((entityId) => {
|
|
31
|
+
if (
|
|
32
|
+
stats[entityId][activity] &&
|
|
33
|
+
stats[entityId][activity] > top.Stats[activity]
|
|
34
|
+
) {
|
|
35
|
+
const entity = _.find(source, (s) => {
|
|
36
|
+
return s[key] === entityId;
|
|
37
|
+
});
|
|
38
|
+
if (entity) {
|
|
39
|
+
top = { Stats: stats[entityId], Entity: entity };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (top.Stats[activity] === 0) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
if (previousStats) {
|
|
47
|
+
top.PreviousStats = previousStats[top.Entity[key]];
|
|
48
|
+
}
|
|
49
|
+
return top;
|
|
44
50
|
};
|
|
45
51
|
|
|
46
52
|
export const getAnalyticsFilterOptions = () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
text: "Yesterday",
|
|
56
|
+
dayCount: 1,
|
|
57
|
+
prevText: "day before",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
text: "Last 7 days",
|
|
61
|
+
dayCount: 7,
|
|
62
|
+
prevText: "previous 7 days",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
text: "Last 14 days",
|
|
66
|
+
dayCount: 14,
|
|
67
|
+
prevText: "previous 14 days",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
text: "Last 30 days",
|
|
71
|
+
dayCount: 30,
|
|
72
|
+
prevText: "previous 30 days",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
text: "Last 90 days",
|
|
76
|
+
dayCount: 90,
|
|
77
|
+
prevText: "previous 90 days",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
text: "Last 365 days",
|
|
81
|
+
dayCount: 365,
|
|
82
|
+
prevText: "previous 365 days",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
text: "Custom Range",
|
|
86
|
+
dayCount: 0,
|
|
87
|
+
prevText: "previous * days",
|
|
88
|
+
},
|
|
89
|
+
];
|
|
84
90
|
};
|
|
85
91
|
|
|
86
92
|
export const countActivities = (data, activityKey, countType) => {
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
let count = 0;
|
|
94
|
+
let set = new Set();
|
|
89
95
|
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
data.forEach((entry) => {
|
|
97
|
+
const stats = entry.Stats;
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
for (const entity in stats) {
|
|
100
|
+
const entityStats = stats[entity];
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
102
|
+
switch (countType) {
|
|
103
|
+
case "unique":
|
|
104
|
+
if (entityStats[activityKey]) {
|
|
105
|
+
set.add(entity);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case "uniquearray":
|
|
109
|
+
if (entityStats[activityKey]) {
|
|
110
|
+
_.values(entityStats[activityKey]).forEach((value) => {
|
|
111
|
+
set.add(value);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case "total":
|
|
116
|
+
if (entityStats[activityKey]) {
|
|
117
|
+
count += entityStats[activityKey];
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
119
125
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
switch (countType) {
|
|
127
|
+
case "unique":
|
|
128
|
+
case "uniquearray":
|
|
129
|
+
console.log(countType, set);
|
|
130
|
+
return set.size;
|
|
131
|
+
case "total":
|
|
132
|
+
return count;
|
|
133
|
+
default:
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
130
136
|
};
|
|
131
137
|
|
|
132
|
-
export const generateDateRangeObjects = (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
export const generateDateRangeObjects = (
|
|
139
|
+
startTime,
|
|
140
|
+
endTime,
|
|
141
|
+
groupBy = "day",
|
|
142
|
+
) => {
|
|
143
|
+
const startDate = moment(startTime);
|
|
144
|
+
const endDate = moment(endTime);
|
|
145
|
+
const dates = {};
|
|
136
146
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
while (startDate.isSameOrBefore(endDate)) {
|
|
148
|
+
const dateString = startDate.format("DD-MM-YYYY");
|
|
149
|
+
dates[dateString] = {
|
|
150
|
+
Date: dateString,
|
|
151
|
+
Timestamp: startDate.valueOf(),
|
|
152
|
+
Stats: {},
|
|
153
|
+
};
|
|
154
|
+
startDate.add(1, groupBy);
|
|
155
|
+
}
|
|
146
156
|
|
|
147
|
-
|
|
157
|
+
return dates;
|
|
148
158
|
};
|
|
149
159
|
|
|
150
|
-
export const generateDateActivities = (
|
|
151
|
-
|
|
160
|
+
export const generateDateActivities = (
|
|
161
|
+
data,
|
|
162
|
+
activityKey,
|
|
163
|
+
countType,
|
|
164
|
+
startTime,
|
|
165
|
+
endTime,
|
|
166
|
+
groupBy = "day",
|
|
167
|
+
) => {
|
|
168
|
+
const dates = generateDateRangeObjects(startTime, endTime, groupBy);
|
|
152
169
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
const result = [];
|
|
171
|
+
let formatToUse = "DD-MM-YYYY";
|
|
172
|
+
let labelFormat = "D MMM";
|
|
173
|
+
switch (groupBy) {
|
|
174
|
+
case "month":
|
|
175
|
+
formatToUse = "MM-YYYY";
|
|
176
|
+
labelFormat = "MMMM";
|
|
177
|
+
break;
|
|
178
|
+
case "week":
|
|
179
|
+
formatToUse = "w-gggg";
|
|
180
|
+
labelFormat = "[Week of] D MMM";
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
168
185
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
186
|
+
Object.keys(dates).forEach((d) => {
|
|
187
|
+
const datesToUse = _.filter(data, (date) => {
|
|
188
|
+
return (
|
|
189
|
+
moment(date.Date, "DD-MM-YYYY").format(formatToUse) ===
|
|
190
|
+
moment(d, "DD-MM-YYYY").format(formatToUse)
|
|
191
|
+
);
|
|
192
|
+
}) || [dates[d]];
|
|
193
|
+
const compiledValue = {
|
|
194
|
+
date: d,
|
|
195
|
+
label: moment(d, "DD-MM-YYYY").format(labelFormat),
|
|
196
|
+
value: countActivities(datesToUse, activityKey, countType),
|
|
197
|
+
};
|
|
178
198
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
199
|
+
result.push(compiledValue);
|
|
200
|
+
});
|
|
201
|
+
console.log(result);
|
|
202
|
+
return result;
|
|
183
203
|
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { authedFunction } from
|
|
2
|
-
import { getUrl } from
|
|
1
|
+
import { authedFunction } from "../session";
|
|
2
|
+
import { getUrl } from "../helper";
|
|
3
3
|
|
|
4
4
|
export const analyticsActions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
5
|
+
log: (site, actionType, entityType, entityId, data) => {
|
|
6
|
+
return authedFunction({
|
|
7
|
+
method: "POST",
|
|
8
|
+
url: getUrl("analytics", "log"),
|
|
9
|
+
data: {
|
|
10
|
+
site,
|
|
11
|
+
actionType,
|
|
12
|
+
entityType,
|
|
13
|
+
entityId,
|
|
14
|
+
data,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
getEntityStats: (entityId, entityType) => {
|
|
19
|
+
return authedFunction({
|
|
20
|
+
method: "GET",
|
|
21
|
+
url: getUrl("analytics", "getentity", { entityId, entityType }),
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
getActivityLog: (entityId, entityType, actionType, minTime, maxTime) => {
|
|
25
|
+
const query = { entityId, entityType, actionType };
|
|
26
|
+
if (minTime) {
|
|
27
|
+
query.minTime = minTime;
|
|
28
|
+
}
|
|
29
|
+
if (maxTime) {
|
|
30
|
+
query.maxTime = maxTime;
|
|
31
|
+
}
|
|
32
|
+
return authedFunction({
|
|
33
|
+
method: "GET",
|
|
34
|
+
url: getUrl("analytics", "activity", query),
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
getAggregateUserStats: (site) => {
|
|
38
|
+
return authedFunction({
|
|
39
|
+
method: "GET",
|
|
40
|
+
url: getUrl("analytics", "users", { site }),
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
getAggregateEntityStats: (site, type, minTime, maxTime, raw) => {
|
|
44
|
+
const query = { site, type, minTime, maxTime };
|
|
45
|
+
if (raw) {
|
|
46
|
+
query.raw = raw;
|
|
47
|
+
}
|
|
48
|
+
return authedFunction({
|
|
49
|
+
method: "GET",
|
|
50
|
+
url: getUrl("analytics", "aggregate", query),
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
53
|
};
|
package/src/apis/authActions.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import axios from
|
|
2
|
-
import { getUrl } from
|
|
3
|
-
import { authedFunction } from
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { getUrl } from "../helper";
|
|
3
|
+
import { authedFunction } from "../session";
|
|
4
4
|
|
|
5
5
|
export const authActions = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
6
|
+
checkUserAuth: (userId) => {
|
|
7
|
+
let url = getUrl("auth", "checkUserAuth");
|
|
8
|
+
return authedFunction({
|
|
9
|
+
method: "POST",
|
|
10
|
+
url,
|
|
11
|
+
data: {
|
|
12
|
+
userId,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
fetchForgotPasswordId: (input) => {
|
|
17
|
+
return axios({
|
|
18
|
+
method: "POST",
|
|
19
|
+
url: getUrl("auth", "checkForgotUser"),
|
|
20
|
+
data: {
|
|
21
|
+
user: {
|
|
22
|
+
email: input,
|
|
23
|
+
phoneNumber: input,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
headers: { authorization: "GwegChicken" },
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
disableUser: (username, site) => {
|
|
30
|
+
let url = getUrl("users", "testUserDisbale");
|
|
31
|
+
const request = {
|
|
32
|
+
method: "POST",
|
|
33
|
+
url,
|
|
34
|
+
data: {
|
|
35
|
+
username,
|
|
36
|
+
site,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
return authedFunction(request);
|
|
40
|
+
},
|
|
41
|
+
getUserSignin: async () => {
|
|
42
|
+
return authedFunction({
|
|
43
|
+
method: "POST",
|
|
44
|
+
url: getUrl("auth", "getUserSignin"),
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
copyDummy: (site) => {
|
|
48
|
+
let url = getUrl("auth", "copyDummy");
|
|
49
|
+
const request = {
|
|
50
|
+
method: "POST",
|
|
51
|
+
url,
|
|
52
|
+
data: {
|
|
53
|
+
site,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return authedFunction(request);
|
|
57
|
+
},
|
|
58
58
|
};
|