@bigbinary/neeto-team-members-frontend 3.0.0 → 3.0.1
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/dist/index.cjs.js +20 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +20 -10
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/types.d.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -5805,6 +5805,9 @@ var fetch = function fetch(params) {
|
|
|
5805
5805
|
});
|
|
5806
5806
|
return axios.get("".concat(BASE_URL, "/teams?").concat(serializedParams));
|
|
5807
5807
|
};
|
|
5808
|
+
var fetchCountsPerCategory = function fetchCountsPerCategory() {
|
|
5809
|
+
return axios.get("".concat(BASE_URL, "/teams/counts_per_category"));
|
|
5810
|
+
};
|
|
5808
5811
|
var create = function create(payload) {
|
|
5809
5812
|
return axios.post("".concat(BASE_URL, "/teams"), payload);
|
|
5810
5813
|
};
|
|
@@ -5826,6 +5829,7 @@ var teamsApi = {
|
|
|
5826
5829
|
create: create,
|
|
5827
5830
|
fetch: fetch,
|
|
5828
5831
|
fetchFilterOptions: fetchFilterOptions,
|
|
5832
|
+
fetchCountsPerCategory: fetchCountsPerCategory,
|
|
5829
5833
|
update: update
|
|
5830
5834
|
};
|
|
5831
5835
|
|
|
@@ -5846,13 +5850,21 @@ var useFetchMembers = function useFetchMembers() {
|
|
|
5846
5850
|
refetchOnWindowFocus: false
|
|
5847
5851
|
}));
|
|
5848
5852
|
};
|
|
5853
|
+
var useFetchMembersCountsPerCategory = function useFetchMembersCountsPerCategory() {
|
|
5854
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5855
|
+
return useQuery([QUERY_KEYS.TEAMS], teamsApi.fetchCountsPerCategory, _objectSpread$8(_objectSpread$8({
|
|
5856
|
+
select: identity,
|
|
5857
|
+
keepPreviousData: true
|
|
5858
|
+
}, options), {}, {
|
|
5859
|
+
refetchOnWindowFocus: false
|
|
5860
|
+
}));
|
|
5861
|
+
};
|
|
5849
5862
|
var useCreateMember = function useCreateMember(_ref) {
|
|
5850
5863
|
var _onSuccess = _ref.onSuccess,
|
|
5851
5864
|
options = _objectWithoutProperties(_ref, _excluded$2);
|
|
5852
|
-
return
|
|
5865
|
+
return useMutationWithInvalidation(teamsApi.create, _objectSpread$8({
|
|
5866
|
+
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5853
5867
|
onSuccess: function onSuccess(response) {
|
|
5854
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
5855
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
5856
5868
|
// @ts-ignore
|
|
5857
5869
|
_onSuccess === null || _onSuccess === void 0 || _onSuccess(response);
|
|
5858
5870
|
}
|
|
@@ -5861,14 +5873,13 @@ var useCreateMember = function useCreateMember(_ref) {
|
|
|
5861
5873
|
var useUpdateMember = function useUpdateMember(_ref2) {
|
|
5862
5874
|
var _onSuccess2 = _ref2.onSuccess,
|
|
5863
5875
|
options = _objectWithoutProperties(_ref2, _excluded2$1);
|
|
5864
|
-
return
|
|
5876
|
+
return useMutationWithInvalidation(function (_ref3) {
|
|
5865
5877
|
var id = _ref3.id,
|
|
5866
5878
|
payload = _ref3.payload;
|
|
5867
5879
|
return teamsApi.update(id, payload);
|
|
5868
5880
|
}, _objectSpread$8({
|
|
5881
|
+
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5869
5882
|
onSuccess: function onSuccess() {
|
|
5870
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
5871
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
5872
5883
|
_onSuccess2 === null || _onSuccess2 === void 0 || _onSuccess2();
|
|
5873
5884
|
}
|
|
5874
5885
|
}, options));
|
|
@@ -5876,10 +5887,9 @@ var useUpdateMember = function useUpdateMember(_ref2) {
|
|
|
5876
5887
|
var useBulkUpdateMembers = function useBulkUpdateMembers(_ref4) {
|
|
5877
5888
|
var _onSuccess3 = _ref4.onSuccess,
|
|
5878
5889
|
options = _objectWithoutProperties(_ref4, _excluded3);
|
|
5879
|
-
return
|
|
5890
|
+
return useMutationWithInvalidation(teamsApi.bulkUpdate, _objectSpread$8({
|
|
5891
|
+
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5880
5892
|
onSuccess: function onSuccess() {
|
|
5881
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
5882
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
5883
5893
|
_onSuccess3 === null || _onSuccess3 === void 0 || _onSuccess3();
|
|
5884
5894
|
}
|
|
5885
5895
|
}, options));
|
|
@@ -7766,5 +7776,5 @@ var Profile = {
|
|
|
7766
7776
|
usePaneState: useProfileUpdatePaneState
|
|
7767
7777
|
};
|
|
7768
7778
|
|
|
7769
|
-
export { MANAGE_MEMBERS_PERMISSION, MANAGE_ROLES_PERMISSION, ManageMember, Permissions, Profile, index$1 as Roles, RolesRadioGroup, index as TeamMembers, VIEW_MEMBERS_PERMISSION, VIEW_ROLES_PERMISSION, hasPermission, refetchMembers, useFetchMembers };
|
|
7779
|
+
export { MANAGE_MEMBERS_PERMISSION, MANAGE_ROLES_PERMISSION, ManageMember, Permissions, Profile, index$1 as Roles, RolesRadioGroup, index as TeamMembers, VIEW_MEMBERS_PERMISSION, VIEW_ROLES_PERMISSION, hasPermission, refetchMembers, useFetchMembers, useFetchMembersCountsPerCategory };
|
|
7770
7780
|
//# sourceMappingURL=index.js.map
|