Fixes issue of moving/deleting media along with other issues of us returning plain text responses with incorrect mime type results and an issue with our interceptors
This commit is contained in:
@@ -48,11 +48,14 @@
|
||||
//exit/ignore
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
var filtered = _.find(requestInterceptorFilter(), function (val) {
|
||||
return config.url.indexOf(val) > 0;
|
||||
});
|
||||
if (filtered) {
|
||||
return $q.reject(rejection);
|
||||
|
||||
if (config.url) {
|
||||
var filtered = _.find(requestInterceptorFilter(), function (val) {
|
||||
return config.url.indexOf(val) > 0;
|
||||
});
|
||||
if (filtered) {
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
}
|
||||
|
||||
//A 401 means that the user is not logged in
|
||||
|
||||
@@ -157,7 +157,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, { responseType: 'text' }),
|
||||
'Failed to move content');
|
||||
},
|
||||
|
||||
@@ -198,7 +198,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post(umbRequestHelper.getApiUrl("contentApiBaseUrl", "PostCopy"),
|
||||
args),
|
||||
args, { responseType: 'text' }),
|
||||
'Failed to copy content');
|
||||
},
|
||||
|
||||
@@ -467,7 +467,8 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"contentApiBaseUrl",
|
||||
"GetNiceUrl", [{ id: id }])),
|
||||
"GetNiceUrl", { id: id }),
|
||||
{ responseType: 'text' }),
|
||||
'Failed to retrieve url for id:' + id);
|
||||
},
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter, loca
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, { responseType: 'text' }),
|
||||
'Failed to move content');
|
||||
},
|
||||
|
||||
@@ -286,7 +286,7 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter, loca
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, { responseType: 'text' }),
|
||||
'Failed to copy content');
|
||||
},
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, { responseType: 'text' }),
|
||||
'Failed to move content');
|
||||
},
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, {responseType: 'text'}),
|
||||
'Failed to move media');
|
||||
},
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, { responseType: 'text' }),
|
||||
'Failed to move content');
|
||||
},
|
||||
|
||||
@@ -233,7 +233,7 @@ function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
}, { responseType: 'text' }),
|
||||
'Failed to copy content');
|
||||
},
|
||||
|
||||
|
||||
@@ -152,6 +152,13 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ
|
||||
|
||||
}, function (response) {
|
||||
|
||||
if (!response.status && response.message && response.stack) {
|
||||
//this is a JS/angular error that we should deal with
|
||||
return $q.reject({
|
||||
errorMsg: response.message
|
||||
})
|
||||
}
|
||||
|
||||
//invoke the callback
|
||||
var result = callbacks.error.apply(this, [response.data, response.status, response.headers, response.config]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user