question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Q.serviceRequest List: get response

See original GitHub issue

Dear @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:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
volkanceylancommented, May 31, 2016

Service calls are async by default, it won’t work this way, use last parameter to set it to sync { async: false }

0reactions
marcobisiocommented, Jun 1, 2016

Thank you very much @volkanceylan…I’ll try!

Have a good evening Bye

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found