fix: added additional negative test cases for getApps method. feat: begin writing tests for getAppById method
This commit is contained in:
@@ -73,9 +73,29 @@ export class OnspringClient {
|
||||
);
|
||||
|
||||
var apiResponse = await this.get<any>(endpoint);
|
||||
|
||||
if (apiResponse.isSuccessful === false) {
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
return apiResponse.AsGetPagedAppsResponseType();
|
||||
}
|
||||
|
||||
public async getAppById(appId: number): Promise<ApiResponse<App>> {
|
||||
const endpoint = EndpointFactory.getAppByIdEndpoint(
|
||||
this._client.defaults.baseURL,
|
||||
appId
|
||||
);
|
||||
|
||||
var apiResponse = await this.get<any>(endpoint);
|
||||
|
||||
if (apiResponse.isSuccessful === false) {
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
return apiResponse.AsAppType();
|
||||
}
|
||||
|
||||
/**
|
||||
* @method get - Makes a GET request to the specified endpoint.
|
||||
* @param {string} endpoint - The endpoint that will be used to make the request.
|
||||
|
||||
Reference in New Issue
Block a user