Angualr HttpClient get response it not correct?

92 Views Asked by At

I stumbled across a very weird behavior on HttpClient.get. I am trying to figure this out by myself for an eternity, but it does not make sense to me. I am requesting an array of pretty complex objects but on the clientside some properties are missing, which are sent by the server and even visible in Chrome DevTools Network Tab.

Missing values appear on user => jobApplication[] => updates[].

Here is my method to get objects

    async getRelevantUsers(showError = true): Promise<User[]> {
        const reply = await this.http.get<any>((isDevMode() ? serverConstants.devServerUrl : serverConstants.prodServerUrl) + 'user/relevant', this.requestOptions).pipe(catchError((err, caught) => {
            console.log(err);
            return new Promise(resolve => {
                resolve(undefined);
            });
        })).toPromise();
        if (reply) {
            console.log(reply);
            return reply;
        }
        return undefined;
    }

Here the response in Chrome DevTools network Tab for a specific user from the list (Postman shows the same outcome):

enter image description here

The following image shows the response of the same user from the console.log(...) point of view in the method i posted here. Why is there only one element in the array updates instead of multiple like sent by the server? It does not get manipulated by myself, where is the problem?

enter image description here

Angular appends only the last update with id 19 ?? why

0

There are 0 best solutions below