angular.module('umbraco.resources').factory('testResource',
function ($q, $http, umbRequestHelper) {
// the factory object returned
return {
// this calls the ApiController we setup earlier
getDatabases: function () {
return umbRequestHelper.resourcePromise(
$http.get("backoffice/Test/GetDatabases"),
"Failed to retrieve all Person data");
}
};
}
);
Umbraco Back Office Routing
Umbraco 10
I am trying to extend the back office. I want to communicate with a custom database. I keep getting the following error:
I have tried several different things. Nothing works. Below is my code.
Umbraco controller:
AngularJS controller:
AngularJS Resource:
Dashboard:
I think you are mixing newer documentation with an older Umbraco version.
If you look at this documentation: https://docs.umbraco.com/umbraco-cms/10.latest/reference/routing/umbraco-api-controllers
UmbracoApiControllers get routing added automaticly.
The default route for the UmnbracoAuthorizedApiController is: ~/Umbraco/backoffice/Api/[YourControllerName]
Or if you add the plugincontroller attribute: ~/Umbraco/backoffice/[YourAreaName]/[YourControllerName]
So if you remove the Route attribute the default Url in your case will be: /umbraco/backoffice/api/test/getdatabases
Can you please let me know if this fixed your issue?
is working on a reply...