@iankibetsh/shframework 5.0.9 → 5.1.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/library.js +10 -29
- package/dist/library.mjs +10 -29
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -225,41 +225,22 @@ async function runPlainRequest(url, message, title, data){
|
|
|
225
225
|
reverseButtons: true,
|
|
226
226
|
showLoaderOnConfirm: true,
|
|
227
227
|
preConfirm: () => {
|
|
228
|
-
return shApis.doPost(url, data)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
})
|
|
228
|
+
return shApis.doPost(url, data).then(function (response){
|
|
229
|
+
return {
|
|
230
|
+
response: response.data,
|
|
231
|
+
success: true
|
|
232
|
+
}
|
|
233
|
+
})
|
|
235
234
|
.catch(error => {
|
|
236
235
|
return {
|
|
237
236
|
success: false,
|
|
238
237
|
error: error,
|
|
239
238
|
message: error.message
|
|
240
|
-
}
|
|
241
|
-
})
|
|
239
|
+
}
|
|
240
|
+
})
|
|
242
241
|
},
|
|
243
242
|
allowOutsideClick: () => !Swal__default["default"].isLoading()
|
|
244
|
-
})
|
|
245
|
-
if (result.isDismissed) {
|
|
246
|
-
// Handle the cancel action
|
|
247
|
-
throw new Error();
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// Continue processing on confirm
|
|
251
|
-
if (result.isConfirmed) {
|
|
252
|
-
const { success, response, error } = result.value;
|
|
253
|
-
if (!success) {
|
|
254
|
-
// Handle the API error
|
|
255
|
-
console.error('API error:', error);
|
|
256
|
-
throw new Error('API request failed: ' + error.message);
|
|
257
|
-
}
|
|
258
|
-
// Handle the successful response
|
|
259
|
-
return response;
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
|
|
243
|
+
})
|
|
263
244
|
}
|
|
264
245
|
async function confirmAction(title,message){
|
|
265
246
|
if (typeof title === 'undefined') {
|
|
@@ -6025,7 +6006,7 @@ const setTabCounts = (tabCounts) => {
|
|
|
6025
6006
|
const resetTabCounts = () => {
|
|
6026
6007
|
const arr = route.fullPath.split('/');
|
|
6027
6008
|
if (!tabExistsInUrl()) {
|
|
6028
|
-
router.
|
|
6009
|
+
router.replace(route.fullPath + '/tab/' + props.tabs[0]);
|
|
6029
6010
|
} else {
|
|
6030
6011
|
currentTab.value = arr[arr.length - 1];
|
|
6031
6012
|
}
|
package/dist/library.mjs
CHANGED
|
@@ -213,41 +213,22 @@ async function runPlainRequest(url, message, title, data){
|
|
|
213
213
|
reverseButtons: true,
|
|
214
214
|
showLoaderOnConfirm: true,
|
|
215
215
|
preConfirm: () => {
|
|
216
|
-
return shApis.doPost(url, data)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
})
|
|
216
|
+
return shApis.doPost(url, data).then(function (response){
|
|
217
|
+
return {
|
|
218
|
+
response: response.data,
|
|
219
|
+
success: true
|
|
220
|
+
}
|
|
221
|
+
})
|
|
223
222
|
.catch(error => {
|
|
224
223
|
return {
|
|
225
224
|
success: false,
|
|
226
225
|
error: error,
|
|
227
226
|
message: error.message
|
|
228
|
-
}
|
|
229
|
-
})
|
|
227
|
+
}
|
|
228
|
+
})
|
|
230
229
|
},
|
|
231
230
|
allowOutsideClick: () => !Swal.isLoading()
|
|
232
|
-
})
|
|
233
|
-
if (result.isDismissed) {
|
|
234
|
-
// Handle the cancel action
|
|
235
|
-
throw new Error();
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Continue processing on confirm
|
|
239
|
-
if (result.isConfirmed) {
|
|
240
|
-
const { success, response, error } = result.value;
|
|
241
|
-
if (!success) {
|
|
242
|
-
// Handle the API error
|
|
243
|
-
console.error('API error:', error);
|
|
244
|
-
throw new Error('API request failed: ' + error.message);
|
|
245
|
-
}
|
|
246
|
-
// Handle the successful response
|
|
247
|
-
return response;
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
|
|
231
|
+
})
|
|
251
232
|
}
|
|
252
233
|
async function confirmAction(title,message){
|
|
253
234
|
if (typeof title === 'undefined') {
|
|
@@ -6013,7 +5994,7 @@ const setTabCounts = (tabCounts) => {
|
|
|
6013
5994
|
const resetTabCounts = () => {
|
|
6014
5995
|
const arr = route.fullPath.split('/');
|
|
6015
5996
|
if (!tabExistsInUrl()) {
|
|
6016
|
-
router.
|
|
5997
|
+
router.replace(route.fullPath + '/tab/' + props.tabs[0]);
|
|
6017
5998
|
} else {
|
|
6018
5999
|
currentTab.value = arr[arr.length - 1];
|
|
6019
6000
|
}
|