savvato-software / tribe-app-frontend

5 stars 21 forks source link

DEBT: Replace the deprecated subscribe calls in our API services #144

Open haxwell opened 2 months ago

haxwell commented 2 months ago

See https://github.com/savvato-software/tribe-app-frontend/pull/143

Each API call should look generally like:

getAllConnections(userId: number) {
    const url = environment.apiUrl + '/api/connect/' + userId + '/all';
    return this._apiService.get(url).subscribe({
            next: (_data) => {
                resolve(_data);
            },
            error: (err) => {
                reject(err);
            }
    })
}

Notice this method just returns the apiService.get() call, it does not create a Promise of its own.

We need to do that same thing for each API service, as appropriate.