Q.serviceRequest List: get response
See original GitHub issueDear @volkanceylan, I have some problem to properly use the Q.serviceRequest method. I’m trying to create a custom editor with an overriden getItems() method:
namespace x.y {
@Serenity.Decorators.registerEditor()
export class OwnerEditor extends Serenity.LookupEditorBase<Administration.UserRow, any> {
constructor(hidden: JQuery) {
super(hidden);
}
protected getLookupKey() {
return 'Administration.User';
}
protected getItems(lookup: Q.Lookup<Administration.UserRow>) {
var userSupportGroups: Administration.UserSupportGroupListResponse;
Q.serviceRequest(Administration.UserSupportGroupService.Methods.List, { UserID: Authorization.userDefinition.UserId }, (response) => {
userSupportGroups = response;
});
return super.getItems(lookup).filter(__TBD__);
}
}
}
Server side it’s working fine (I got the response with my support groups entities), but typescript side I’m doing some kind of mistake…I mean the “userSupportGroups” variable is always undefined… In the previous code, how to properly retrieve the response of the list servicerequest?
Thank you very much Bye
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Q.serviceRequest List: get response · Issue #753 · serenity- ...
serviceRequest method. I'm trying to create a custom editor with an overriden getItems() method: namespace x.y { @Serenity.Decorators.
Read more >Service Endpoints · Serenity Developer Guide
Even though, List, Retrieve can be called by GET, Serenity always calls services using HTTP POST when you use its methods, e.g. Q.CallService,...
Read more >Calling a Serenity service endpoint and react to success or ...
face same issue , i resolved this by. Q.serviceCall<Serenity.RetrieveResponse<any>>({ service: this.serviceUrl + '/Retrieve', request: ...
Read more >Get data from a server
Generate the class src/app/in-memory-data.service.ts with the following command: ... HttpClient.get() returns the body of the response as an untyped JSON ...
Read more >java - rxjava - getting response and inserting diff parallelly
You will just have to do this to access the result aggregate: getBothServiceResponses(serviceRequest, prodId).subscribe(...) Share.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Service calls are async by default, it won’t work this way, use last parameter to set it to sync { async: false }
Thank you very much @volkanceylan…I’ll try!
Have a good evening Bye