feat: implement deleteRecordById method

This commit is contained in:
Stevan Freeborn
2023-02-13 11:30:26 -06:00
parent f5ce1d8b13
commit 708cf65844
2 changed files with 160 additions and 0 deletions
+18
View File
@@ -397,6 +397,24 @@ export class OnspringClient {
return apiResponse.asGetPagedRecordsResponseType();
}
/**
* @method deleteRecordById - Deletes a record by its id.
* @param {number} appId - The id of the app that the record belongs to.
* @param {number} recordId - The id of the record to delete.
* @returns {Promise<ApiResponse<any>>} - A promise that resolves to an ApiResponse of type any.
*/
public async deleteRecordById(
appId: number,
recordId: number
): Promise<ApiResponse<any>> {
const endpoint = EndpointFactory.getDeleteRecordByIdEndpoint(
appId,
recordId
);
const apiResponse = await this.delete<any>(endpoint);
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.