Hi,
I am building an integration into an api. As a starting point I need to authorise the application.
Normally, following command from the controller works. return Redirect(url);
however, in my case I am executing an action from the jQuery action.
I have this snippet from the jQuery script, which is calling the controller correctly. text: app.localize('Authorise'), visible: function () { return entityHistoryIsEnabled(); }, action: function (data) { abp.ajax({ url: '/App/Integrations/Register', data: JSON.stringify({ id: data.record.Integration.id }), }); }
However, the ABP is expecting a JSON response and redirect fails.
If I move the controller code to Index(), it works fine.
Any advice on what command to use to redirect from tje jQuery script?
I can return the URL as JSON back to the script and redirect from there.
Reference: https://aspnetboilerplate.com/Pages/Documents/Javascript-API/AJAX
Many thanks.
Regards, Vikas
Closing ticket
Thank you.
@aaron: What I mean is that any methods that as written as ApplicationService in Projectname.Application project seems to be available as an API.
If any database operation methods are written elsewhere, they won't be availabe as API?
Just want to verify my understanding.
Thanks @aaron.
I was able to make it work.
Does the Application Service expose the services as API? Coding directly in contoller would mean no api for that operation?
Regads, Vikas
Hi,
I want to simply the design for some of my controllers and use the Repository directly from controller.
Is there an example snippet anyone can provide?
Many thanks in advance.
Best Regards, Vikas
Hi @ismcagdas.
Everything working now, execpt the localisation for dropdown was not getting picket up.
Line 140 needs a small fix in following. Can you review and get that logged as github issue?
https://github.com/aspnetzero/aspnet-zero-core/commit/7eb8a38d46bc704dbc6250b49e240c149900caf7
entityHistoryObjectTypes.Add(new NameValueDto(enabledEntity, enabledEntity));
entityHistoryObjectTypes.Add(new NameValueDto(L(enabledEntity), enabledEntity));
Thank you for your help :)
Hi,
My project's Change log shows Namespaces instead of Entity Name.
Is there a way to fix this?
Also, the dropdown does not have the Objects available.
Note, My entities have entity history enabled with [Audited] tag and lines uncommented in *EntityFrameworkCoreModule.cs
Thanks for replying.
Regards, Vikas
Thanks. It does look like this issue.
I come from SAP background and this is a key Enterprise feature.
It would be good to have the table as a source.
I will do some workaround for now.
Regards, Vikas