@bindu-dashing/dam-solution-v2 5.8.120 → 5.8.121
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.
|
@@ -130,17 +130,27 @@ function FileMenuOptions({ file, folderIds = [], fileIds = [], folder, onCloseSe
|
|
|
130
130
|
const onFailure = (message) => {
|
|
131
131
|
showNotification(message, NotificationStatus.ERROR);
|
|
132
132
|
};
|
|
133
|
-
const onDeleteSuccess = (message) => {
|
|
134
|
-
|
|
133
|
+
const onDeleteSuccess = (message) => __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
if (refetchFolders) {
|
|
135
|
+
yield refetchFolders();
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const foldersQueryKey = generateFoldersQueryKey(type);
|
|
139
|
+
const currentFolderId = folderId ? folderId : rootFolderId;
|
|
140
|
+
invalidateData(queryClient, foldersQueryKey, currentFolderId);
|
|
141
|
+
yield queryClient.refetchQueries({
|
|
142
|
+
queryKey: [foldersQueryKey, currentFolderId],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
135
145
|
showNotification(message, NotificationStatus.SUCCESS);
|
|
136
146
|
onCloseSelection === null || onCloseSelection === void 0 ? void 0 : onCloseSelection();
|
|
137
|
-
};
|
|
147
|
+
});
|
|
138
148
|
const deleteFileMutation = useMutation({
|
|
139
149
|
mutationFn: deleteFiles,
|
|
140
|
-
onSuccess: (response) => {
|
|
150
|
+
onSuccess: (response) => __awaiter(this, void 0, void 0, function* () {
|
|
141
151
|
toggleConfirmPopup();
|
|
142
|
-
onDeleteSuccess(get(response, "data.message", DELETE_SUCCESS));
|
|
143
|
-
},
|
|
152
|
+
yield onDeleteSuccess(get(response, "data.message", DELETE_SUCCESS));
|
|
153
|
+
}),
|
|
144
154
|
onError: (error) => {
|
|
145
155
|
onFailure(get(error, "message", SOMETHING_WENT_WRONG));
|
|
146
156
|
},
|
|
@@ -154,10 +164,10 @@ function FileMenuOptions({ file, folderIds = [], fileIds = [], folder, onCloseSe
|
|
|
154
164
|
};
|
|
155
165
|
const archiveFileMutation = useMutation({
|
|
156
166
|
mutationFn: archiveFiles,
|
|
157
|
-
onSuccess: (response) => {
|
|
167
|
+
onSuccess: (response) => __awaiter(this, void 0, void 0, function* () {
|
|
158
168
|
toggleConfirmPopup();
|
|
159
|
-
onDeleteSuccess(get(response, "data.message", ARCHIVE_SUCCESS));
|
|
160
|
-
},
|
|
169
|
+
yield onDeleteSuccess(get(response, "data.message", ARCHIVE_SUCCESS));
|
|
170
|
+
}),
|
|
161
171
|
onError: (error) => {
|
|
162
172
|
onFailure(get(error, "message", SOMETHING_WENT_WRONG));
|
|
163
173
|
},
|