feat: add integration tests for queryRecords and deleteRecordsByIds methods. fix: implemented deleteRecordsByIds method and wrote unit tests

This commit is contained in:
StevanFreeborn
2023-02-19 23:55:47 -06:00
parent 9c44efe567
commit 3bf65f24d9
6 changed files with 503 additions and 105 deletions
+18
View File
@@ -452,6 +452,24 @@ export class OnspringClient {
return apiResponse;
}
/**
* @method deleteRecordsByIds - Deletes records by their ids.
* @param {number} appId - The id of the app that the records belong to.
* @param {number[]} recordIds - The ids of the records to delete.
* @returns {Promise<ApiResponse<any>>} - A promise that resolves to an ApiResponse of type any.
*/
public async deleteRecordsByIds(
appId: number,
recordIds: number[]
): Promise<ApiResponse<any>> {
const endpoint = EndpointFactory.getDeleteRecordsByIdsEndpoint();
const apiResponse = await this.post<any>(endpoint, {
appId,
recordIds,
});
return apiResponse;
}
/**
* @method getReportsByAppId - Gets a paged list of reports by the app id.
* @param {number} appId - The id of the app to get the reports for.