@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.
Files changed (112) hide show
  1. package/package.json +1 -2
  2. package/rollup.config.js +45 -45
  3. package/src/actions/AuthActions.js +40 -40
  4. package/src/actions/LocalActions.js +5 -5
  5. package/src/actions/NavActions.js +5 -5
  6. package/src/actions/ScheduledActionsActions.js +5 -5
  7. package/src/actions/TemplateActions.js +9 -9
  8. package/src/actions/UsersActions.js +74 -70
  9. package/src/actions/index.js +6 -6
  10. package/src/actions/types.js +17 -17
  11. package/src/analytics.js +178 -158
  12. package/src/apis/analyticsActions.js +50 -50
  13. package/src/apis/authActions.js +55 -55
  14. package/src/apis/fileActions.js +147 -142
  15. package/src/apis/index.js +10 -10
  16. package/src/apis/profileActions.js +130 -130
  17. package/src/apis/scheduledActionsActions.js +9 -9
  18. package/src/apis/stringActions.js +26 -22
  19. package/src/apis/templateActions.js +38 -38
  20. package/src/apis/typeActions.js +183 -183
  21. package/src/apis/userActions.js +166 -166
  22. package/src/apis/utilityActions.js +32 -32
  23. package/src/colours.js +79 -77
  24. package/src/components/AddButton.js +29 -20
  25. package/src/components/AnalyticsFilter.js +136 -102
  26. package/src/components/Attachment.js +36 -22
  27. package/src/components/AudienceIncluder.js +209 -165
  28. package/src/components/AudienceSelector.js +680 -680
  29. package/src/components/Button.js +79 -56
  30. package/src/components/CheckBox.js +77 -65
  31. package/src/components/ColourOptions.js +205 -181
  32. package/src/components/ColourPicker.js +286 -244
  33. package/src/components/Comment.js +48 -39
  34. package/src/components/CommentSection.js +113 -103
  35. package/src/components/DatePicker.js +298 -255
  36. package/src/components/DropdownInput.js +236 -215
  37. package/src/components/DurationInput.js +46 -43
  38. package/src/components/ExportCsvPopup.js +236 -217
  39. package/src/components/FileInput.js +359 -346
  40. package/src/components/GenericInput.js +184 -153
  41. package/src/components/Header.js +88 -65
  42. package/src/components/HubSidebar.js +136 -124
  43. package/src/components/ImageInput.js +1182 -973
  44. package/src/components/InputGroup.js +20 -13
  45. package/src/components/MakerPopup.js +285 -278
  46. package/src/components/MoreMenu.js +21 -17
  47. package/src/components/OptionsSection.js +86 -74
  48. package/src/components/OverlayPage.js +61 -61
  49. package/src/components/OverlayPageBottomButtons.js +38 -38
  50. package/src/components/OverlayPageContents.js +38 -38
  51. package/src/components/OverlayPageSection.js +24 -24
  52. package/src/components/P60Icon.js +38 -33
  53. package/src/components/PageTitle.js +8 -8
  54. package/src/components/Popup.js +114 -95
  55. package/src/components/ProfilePic.js +40 -40
  56. package/src/components/RadioButton.js +142 -126
  57. package/src/components/Reactions.js +66 -66
  58. package/src/components/SVGIcon.js +31 -25
  59. package/src/components/SideNavItem.js +112 -83
  60. package/src/components/StatBox.js +54 -44
  61. package/src/components/StatusButton.js +31 -17
  62. package/src/components/SuccessPopup.js +61 -48
  63. package/src/components/Tabs.js +50 -47
  64. package/src/components/Tag.js +54 -54
  65. package/src/components/Text.js +18 -14
  66. package/src/components/TextFormatPopup.js +77 -49
  67. package/src/components/TimePicker.js +214 -200
  68. package/src/components/ToggleSwitch.js +60 -0
  69. package/src/components/UserListing.js +110 -97
  70. package/src/components/index.js +46 -46
  71. package/src/components/svg-icons.json +819 -819
  72. package/src/config.js +22 -22
  73. package/src/helper/HelpDeskWidget.js +4 -4
  74. package/src/helper/api/getUrl.js +16 -11
  75. package/src/helper/api/getUrlParams.js +8 -5
  76. package/src/helper/api/safeReadParams.js +3 -2
  77. package/src/helper/auth/getUserFromState.js +4 -4
  78. package/src/helper/colours/getAppColourFromState.js +10 -5
  79. package/src/helper/files/canvasImageUploader.js +152 -140
  80. package/src/helper/files/generateImageName.js +6 -6
  81. package/src/helper/files/get1400.js +33 -25
  82. package/src/helper/files/getExtension.js +5 -5
  83. package/src/helper/files/getFileName.js +9 -9
  84. package/src/helper/files/getThumb300.js +37 -29
  85. package/src/helper/files/isVideo.js +3 -3
  86. package/src/helper/helper.js +59 -56
  87. package/src/helper/index.js +29 -29
  88. package/src/helper/site/getMerchantsFromState.js +8 -4
  89. package/src/helper/site/getSiteLevelFromState.js +29 -29
  90. package/src/helper/site/getSiteName.js +11 -11
  91. package/src/helper/site/getSiteNameFromRoles.js +7 -7
  92. package/src/helper/site/getSiteSettingFromState.js +10 -5
  93. package/src/helper/storage/readJSONFromStorage.js +5 -5
  94. package/src/helper/storage/readStorageWithCookie.js +17 -17
  95. package/src/helper/storage/setLocalStorage.js +1 -1
  96. package/src/helper/strings/getFirstName.js +5 -5
  97. package/src/helper/strings/htmlDecode.js +2 -2
  98. package/src/helper/strings/htmlEncode.js +2 -2
  99. package/src/helper/strings/isEmail.js +7 -6
  100. package/src/helper/strings/isUrl.js +7 -7
  101. package/src/helper/strings/onlyAlphanumeric.js +4 -4
  102. package/src/helper/strings/randomString.js +6 -6
  103. package/src/helper/strings/toParagraphed.js +12 -12
  104. package/src/index.js +22 -11
  105. package/src/reducers/ScheduledActionsReducer.js +8 -8
  106. package/src/reducers/TemplatesReducer.js +22 -22
  107. package/src/reducers/index.js +4 -4
  108. package/src/session.js +70 -70
  109. package/src/urls.js +17 -16
  110. package/dist/index.cjs.js +0 -11623
  111. package/dist/index.esm.js +0 -11583
  112. package/dist/index.umd.js +0 -11595
@@ -1,152 +1,157 @@
1
- import { getCurrentUserSub, authedFunction } from '../session';
2
- import Config from '../config';
3
- import { Storage } from 'aws-amplify';
4
- import CanvasImageUploader from '../helper/files/canvasImageUploader';
5
- import $ from 'jquery';
6
- import { generateImageName, randomString, getUrl } from '../helper';
1
+ import { getCurrentUserSub, authedFunction } from "../session";
2
+ import Config from "../config";
3
+ import { Storage } from "aws-amplify";
4
+ import CanvasImageUploader from "../helper/files/canvasImageUploader";
5
+ import $ from "jquery";
6
+ import { generateImageName, randomString, getUrl } from "../helper";
7
7
 
8
8
  export const fileActions = {
9
- uploadMediaAsync: async (file, filename) => {
10
- const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
11
- const userId = await getCurrentUserSub();
12
- const url = `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
9
+ uploadMediaAsync: async (file, filename) => {
10
+ const newFilename = filename.replace(/[^a-z0-9+.]+/gi, "").toLowerCase();
11
+ const userId = await getCurrentUserSub();
12
+ const url = `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
13
13
 
14
- const { baseUploadsUrl, uploadBucket } = Config.env;
15
- await Storage.put(url, file, { level: 'public', bucket: uploadBucket });
16
- console.log('uploaded file', `${baseUploadsUrl}${url}`);
17
- return `${baseUploadsUrl}${url}`;
18
- },
14
+ const { baseUploadsUrl, uploadBucket } = Config.env;
15
+ await Storage.put(url, file, { level: "public", bucket: uploadBucket });
16
+ console.log("uploaded file", `${baseUploadsUrl}${url}`);
17
+ return `${baseUploadsUrl}${url}`;
18
+ },
19
19
 
20
- // readBase64: async (file) => {
21
- // return new Promise((resolve, reject) => {
22
- // var reader = new FileReader();
23
- // reader.readAsDataURL(file);
24
- // reader.onload = () => {
25
- // resolve(reader.result);
26
- // //resolve(reader.result.split(',')[1]);
27
- // };
28
- // reader.onerror = (error) => {
29
- // reject(error);
30
- // };
31
- // });
32
- // },
33
- compressImage: (file, maxSize, quality, noCompress) => {
34
- return new Promise((resolve, reject) => {
35
- if (noCompress) {
36
- resolve(file);
37
- return;
38
- }
39
- var $canvas = $('<canvas>');
40
- $canvas.css('display', 'none');
41
- $('body').append($canvas);
20
+ // readBase64: async (file) => {
21
+ // return new Promise((resolve, reject) => {
22
+ // var reader = new FileReader();
23
+ // reader.readAsDataURL(file);
24
+ // reader.onload = () => {
25
+ // resolve(reader.result);
26
+ // //resolve(reader.result.split(',')[1]);
27
+ // };
28
+ // reader.onerror = (error) => {
29
+ // reject(error);
30
+ // };
31
+ // });
32
+ // },
33
+ compressImage: (file, maxSize, quality, noCompress) => {
34
+ return new Promise((resolve, reject) => {
35
+ if (noCompress) {
36
+ resolve(file);
37
+ return;
38
+ }
39
+ var $canvas = $("<canvas>");
40
+ $canvas.css("display", "none");
41
+ $("body").append($canvas);
42
42
 
43
- var canvasUploader = new CanvasImageUploader({
44
- maxSize: maxSize,
45
- jpegQuality: quality,
46
- });
43
+ var canvasUploader = new CanvasImageUploader({
44
+ maxSize: maxSize,
45
+ jpegQuality: quality,
46
+ });
47
47
 
48
- canvasUploader.readImageToCanvas(file, $canvas, function () {
49
- canvasUploader.saveCanvasToImageData($canvas[0]);
50
- console.log(file);
51
- resolve(fileActions.blobToFile(canvasUploader.getImageData(), file.name));
52
- });
53
- });
54
- },
55
- blobToFile: (theBlob, fileName) => {
56
- const file = new File([theBlob], fileName, { lastModified: new Date() });
57
- console.log(file);
58
- return file;
59
- },
60
- putCanvas: (canvas, filename) => {
61
- return new Promise((resolve, reject) => {
62
- const img = canvas.getTrimmedCanvas().toDataURL('image/png');
63
- const imageData = Buffer.from(img.replace(/^data:image\/\w+;base64,/, ''), 'base64');
48
+ canvasUploader.readImageToCanvas(file, $canvas, function () {
49
+ canvasUploader.saveCanvasToImageData($canvas[0]);
50
+ console.log(file);
51
+ resolve(
52
+ fileActions.blobToFile(canvasUploader.getImageData(), file.name),
53
+ );
54
+ });
55
+ });
56
+ },
57
+ blobToFile: (theBlob, fileName) => {
58
+ const file = new File([theBlob], fileName, { lastModified: new Date() });
59
+ console.log(file);
60
+ return file;
61
+ },
62
+ putCanvas: (canvas, filename) => {
63
+ return new Promise((resolve, reject) => {
64
+ const img = canvas.getTrimmedCanvas().toDataURL("image/png");
65
+ const imageData = Buffer.from(
66
+ img.replace(/^data:image\/\w+;base64,/, ""),
67
+ "base64",
68
+ );
64
69
 
65
- canvas.off();
70
+ canvas.off();
66
71
 
67
- const imgName = generateImageName(filename);
72
+ const imgName = generateImageName(filename);
68
73
 
69
- Storage.put(`images/${imgName}.png`, imageData, {
70
- contentType: 'image/png',
71
- level: 'public',
72
- })
73
- .then((res) => {
74
- console.log('put the image');
75
- return resolve(res);
76
- })
77
- .catch((err) => {
78
- return reject(err);
79
- });
80
- });
81
- },
82
- getMediaFolders: (site) => {
83
- // console.log('getMediaFolders', 'site', site);
84
- const query = { site };
85
- return authedFunction({
86
- method: 'GET',
87
- url: getUrl('media', 'folders', query),
88
- });
89
- },
90
- addMediaFolder: (site, name, published) => {
91
- return authedFunction({
92
- method: 'POST',
93
- url: getUrl('media', 'addFolder'),
94
- data: {
95
- site,
96
- name,
97
- published,
98
- },
99
- });
100
- },
101
- updateMediaFolder: (id, site, name, published) => {
102
- // console.log('updateMediaFolder', 'id', id, 'site', site, 'name', name, 'published', published);
103
- return authedFunction({
104
- method: 'POST',
105
- url: getUrl('media', 'updateFolder'),
106
- data: {
107
- id,
108
- site,
109
- name,
110
- published,
111
- },
112
- });
113
- },
114
- deleteMediaFolder: (id, site) => {
115
- return authedFunction({
116
- method: 'POST',
117
- url: getUrl('media', 'deleteFolder'),
118
- data: {
119
- id,
120
- site,
121
- },
122
- });
123
- },
124
- addImagesToFolder: (id, site, images) => {
125
- return authedFunction({
126
- method: 'POST',
127
- url: getUrl('media', 'addImages'),
128
- data: {
129
- id,
130
- site,
131
- images,
132
- },
133
- });
134
- },
135
- deleteImagesFromFolder: (id, site, images) => {
136
- return authedFunction({
137
- method: 'POST',
138
- url: getUrl('media', 'deleteImages'),
139
- data: {
140
- id,
141
- site,
142
- images,
143
- },
144
- });
145
- },
146
- getMediaLibrary: () => {
147
- return authedFunction({
148
- method: 'GET',
149
- url: 'https://pluss60.pluss60-api.com/media-demo/library',
150
- });
151
- },
74
+ Storage.put(`images/${imgName}.png`, imageData, {
75
+ contentType: "image/png",
76
+ level: "public",
77
+ })
78
+ .then((res) => {
79
+ console.log("put the image");
80
+ return resolve(res);
81
+ })
82
+ .catch((err) => {
83
+ return reject(err);
84
+ });
85
+ });
86
+ },
87
+ getMediaFolders: (site) => {
88
+ // console.log('getMediaFolders', 'site', site);
89
+ const query = { site };
90
+ return authedFunction({
91
+ method: "GET",
92
+ url: getUrl("media", "folders", query),
93
+ });
94
+ },
95
+ addMediaFolder: (site, name, published) => {
96
+ return authedFunction({
97
+ method: "POST",
98
+ url: getUrl("media", "addFolder"),
99
+ data: {
100
+ site,
101
+ name,
102
+ published,
103
+ },
104
+ });
105
+ },
106
+ updateMediaFolder: (id, site, name, published) => {
107
+ // console.log('updateMediaFolder', 'id', id, 'site', site, 'name', name, 'published', published);
108
+ return authedFunction({
109
+ method: "POST",
110
+ url: getUrl("media", "updateFolder"),
111
+ data: {
112
+ id,
113
+ site,
114
+ name,
115
+ published,
116
+ },
117
+ });
118
+ },
119
+ deleteMediaFolder: (id, site) => {
120
+ return authedFunction({
121
+ method: "POST",
122
+ url: getUrl("media", "deleteFolder"),
123
+ data: {
124
+ id,
125
+ site,
126
+ },
127
+ });
128
+ },
129
+ addImagesToFolder: (id, site, images) => {
130
+ return authedFunction({
131
+ method: "POST",
132
+ url: getUrl("media", "addImages"),
133
+ data: {
134
+ id,
135
+ site,
136
+ images,
137
+ },
138
+ });
139
+ },
140
+ deleteImagesFromFolder: (id, site, images) => {
141
+ return authedFunction({
142
+ method: "POST",
143
+ url: getUrl("media", "deleteImages"),
144
+ data: {
145
+ id,
146
+ site,
147
+ images,
148
+ },
149
+ });
150
+ },
151
+ getMediaLibrary: () => {
152
+ return authedFunction({
153
+ method: "GET",
154
+ url: "https://pluss60.pluss60-api.com/media-demo/library",
155
+ });
156
+ },
152
157
  };
package/src/apis/index.js CHANGED
@@ -1,10 +1,10 @@
1
- export * from './analyticsActions';
2
- export * from './authActions';
3
- export * from './fileActions';
4
- export * from './typeActions';
5
- export * from './stringActions';
6
- export * from './userActions';
7
- export * from './profileActions';
8
- export * from './utilityActions';
9
- export * from './templateActions';
10
- export * from './scheduledActionsActions';
1
+ export * from "./analyticsActions";
2
+ export * from "./authActions";
3
+ export * from "./fileActions";
4
+ export * from "./typeActions";
5
+ export * from "./stringActions";
6
+ export * from "./userActions";
7
+ export * from "./profileActions";
8
+ export * from "./utilityActions";
9
+ export * from "./templateActions";
10
+ export * from "./scheduledActionsActions";
@@ -1,133 +1,133 @@
1
- import { authedFunction } from '../session';
2
- import { getUrl } from '../helper';
1
+ import { authedFunction } from "../session";
2
+ import { getUrl } from "../helper";
3
3
 
4
4
  export const profileActions = {
5
- addEC: (userId, name, phone, email, relationship) => {
6
- return authedFunction({
7
- method: 'POST',
8
- url: getUrl('profile', 'emergencycontacts/add'),
9
- data: { userId, name, phone, email, relationship },
10
- });
11
- },
12
- editEC: (id, userId, name, phone, email, relationship) => {
13
- return authedFunction({
14
- method: 'POST',
15
- url: getUrl('profile', 'emergencycontacts/edit'),
16
- data: { id, userId, name, phone, email, relationship },
17
- });
18
- },
19
- deleteEC: (id) => {
20
- return authedFunction({
21
- method: 'POST',
22
- url: getUrl('profile', 'emergencycontacts/delete'),
23
- data: { id },
24
- });
25
- },
26
- getECs: (userId) => {
27
- return authedFunction({
28
- method: 'GET',
29
- url: getUrl('profile', 'emergencycontacts/user', { userId }),
30
- });
31
- },
32
- addPD: (userId, name, url, isPublic) => {
33
- return authedFunction({
34
- method: 'POST',
35
- url: getUrl('profile', 'personaldocuments/add'),
36
- data: { userId, name, url, isPublic },
37
- });
38
- },
39
- editPD: (id, userId, name, url, isPublic) => {
40
- return authedFunction({
41
- method: 'POST',
42
- url: getUrl('profile', 'personaldocuments/edit'),
43
- data: { id, userId, name, url, isPublic },
44
- });
45
- },
46
- deletePD: (id) => {
47
- return authedFunction({
48
- method: 'POST',
49
- url: getUrl('profile', 'personaldocuments/delete'),
50
- data: { id },
51
- });
52
- },
53
- getPDs: (userId) => {
54
- return authedFunction({
55
- method: 'GET',
56
- url: getUrl('profile', 'personaldocuments/user', { userId }),
57
- });
58
- },
59
- addPN: (userId, title, text, attachments) => {
60
- return authedFunction({
61
- method: 'POST',
62
- url: getUrl('profile', 'personalnotes/add'),
63
- data: { userId, title, text, attachments },
64
- });
65
- },
66
- editPN: (id, title, text, attachments) => {
67
- return authedFunction({
68
- method: 'POST',
69
- url: getUrl('profile', 'personalnotes/edit'),
70
- data: { id, title, text, attachments },
71
- });
72
- },
73
- deletePN: (id) => {
74
- return authedFunction({
75
- method: 'POST',
76
- url: getUrl('profile', 'personalnotes/delete'),
77
- data: { id },
78
- });
79
- },
80
- getPNs: (userId) => {
81
- return authedFunction({
82
- method: 'GET',
83
- url: getUrl('profile', 'personalnotes/user', { userId }),
84
- });
85
- },
86
- addUserTag: (site, title) => {
87
- return authedFunction({
88
- method: 'POST',
89
- url: getUrl('profile', 'usertags/add'),
90
- data: { site, title },
91
- });
92
- },
93
- editUserTag: (id, title) => {
94
- return authedFunction({
95
- method: 'POST',
96
- url: getUrl('profile', 'usertags/edit'),
97
- data: { id, title },
98
- });
99
- },
100
- deleteUserTag: (id) => {
101
- return authedFunction({
102
- method: 'POST',
103
- url: getUrl('profile', 'usertags/delete'),
104
- data: { id },
105
- });
106
- },
107
- attachUserTag: (tagId, userId) => {
108
- return authedFunction({
109
- method: 'POST',
110
- url: getUrl('profile', 'usertags/attach'),
111
- data: { tagId, userId },
112
- });
113
- },
114
- detachUserTag: (tagId, userId) => {
115
- return authedFunction({
116
- method: 'POST',
117
- url: getUrl('profile', 'usertags/detach'),
118
- data: { tagId, userId },
119
- });
120
- },
121
- getUserTagsByUser: (userId) => {
122
- return authedFunction({
123
- method: 'GET',
124
- url: getUrl('profile', 'usertags/user', { userId }),
125
- });
126
- },
127
- getUserTagsBySite: (site) => {
128
- return authedFunction({
129
- method: 'GET',
130
- url: getUrl('profile', 'usertags/site', { site }),
131
- });
132
- },
5
+ addEC: (userId, name, phone, email, relationship) => {
6
+ return authedFunction({
7
+ method: "POST",
8
+ url: getUrl("profile", "emergencycontacts/add"),
9
+ data: { userId, name, phone, email, relationship },
10
+ });
11
+ },
12
+ editEC: (id, userId, name, phone, email, relationship) => {
13
+ return authedFunction({
14
+ method: "POST",
15
+ url: getUrl("profile", "emergencycontacts/edit"),
16
+ data: { id, userId, name, phone, email, relationship },
17
+ });
18
+ },
19
+ deleteEC: (id) => {
20
+ return authedFunction({
21
+ method: "POST",
22
+ url: getUrl("profile", "emergencycontacts/delete"),
23
+ data: { id },
24
+ });
25
+ },
26
+ getECs: (userId) => {
27
+ return authedFunction({
28
+ method: "GET",
29
+ url: getUrl("profile", "emergencycontacts/user", { userId }),
30
+ });
31
+ },
32
+ addPD: (userId, name, url, isPublic) => {
33
+ return authedFunction({
34
+ method: "POST",
35
+ url: getUrl("profile", "personaldocuments/add"),
36
+ data: { userId, name, url, isPublic },
37
+ });
38
+ },
39
+ editPD: (id, userId, name, url, isPublic) => {
40
+ return authedFunction({
41
+ method: "POST",
42
+ url: getUrl("profile", "personaldocuments/edit"),
43
+ data: { id, userId, name, url, isPublic },
44
+ });
45
+ },
46
+ deletePD: (id) => {
47
+ return authedFunction({
48
+ method: "POST",
49
+ url: getUrl("profile", "personaldocuments/delete"),
50
+ data: { id },
51
+ });
52
+ },
53
+ getPDs: (userId) => {
54
+ return authedFunction({
55
+ method: "GET",
56
+ url: getUrl("profile", "personaldocuments/user", { userId }),
57
+ });
58
+ },
59
+ addPN: (userId, title, text, attachments) => {
60
+ return authedFunction({
61
+ method: "POST",
62
+ url: getUrl("profile", "personalnotes/add"),
63
+ data: { userId, title, text, attachments },
64
+ });
65
+ },
66
+ editPN: (id, title, text, attachments) => {
67
+ return authedFunction({
68
+ method: "POST",
69
+ url: getUrl("profile", "personalnotes/edit"),
70
+ data: { id, title, text, attachments },
71
+ });
72
+ },
73
+ deletePN: (id) => {
74
+ return authedFunction({
75
+ method: "POST",
76
+ url: getUrl("profile", "personalnotes/delete"),
77
+ data: { id },
78
+ });
79
+ },
80
+ getPNs: (userId) => {
81
+ return authedFunction({
82
+ method: "GET",
83
+ url: getUrl("profile", "personalnotes/user", { userId }),
84
+ });
85
+ },
86
+ addUserTag: (site, title) => {
87
+ return authedFunction({
88
+ method: "POST",
89
+ url: getUrl("profile", "usertags/add"),
90
+ data: { site, title },
91
+ });
92
+ },
93
+ editUserTag: (id, title) => {
94
+ return authedFunction({
95
+ method: "POST",
96
+ url: getUrl("profile", "usertags/edit"),
97
+ data: { id, title },
98
+ });
99
+ },
100
+ deleteUserTag: (id) => {
101
+ return authedFunction({
102
+ method: "POST",
103
+ url: getUrl("profile", "usertags/delete"),
104
+ data: { id },
105
+ });
106
+ },
107
+ attachUserTag: (tagId, userId) => {
108
+ return authedFunction({
109
+ method: "POST",
110
+ url: getUrl("profile", "usertags/attach"),
111
+ data: { tagId, userId },
112
+ });
113
+ },
114
+ detachUserTag: (tagId, userId) => {
115
+ return authedFunction({
116
+ method: "POST",
117
+ url: getUrl("profile", "usertags/detach"),
118
+ data: { tagId, userId },
119
+ });
120
+ },
121
+ getUserTagsByUser: (userId) => {
122
+ return authedFunction({
123
+ method: "GET",
124
+ url: getUrl("profile", "usertags/user", { userId }),
125
+ });
126
+ },
127
+ getUserTagsBySite: (site) => {
128
+ return authedFunction({
129
+ method: "GET",
130
+ url: getUrl("profile", "usertags/site", { site }),
131
+ });
132
+ },
133
133
  };
@@ -1,12 +1,12 @@
1
- import { getUrl } from '../helper';
2
- import { authedFunction } from '../session';
1
+ import { getUrl } from "../helper";
2
+ import { authedFunction } from "../session";
3
3
 
4
4
  export const scheduledActionsActions = {
5
- getActions: (site, entityKey) => {
6
- const query = { site, entityKey };
7
- return authedFunction({
8
- method: 'GET',
9
- url: getUrl('scheduledactions', 'get/list', query),
10
- });
11
- },
5
+ getActions: (site, entityKey) => {
6
+ const query = { site, entityKey };
7
+ return authedFunction({
8
+ method: "GET",
9
+ url: getUrl("scheduledactions", "get/list", query),
10
+ });
11
+ },
12
12
  };