fix: begin writing Lists integration tests. fix: list item response model's id value should be of type string so modified the created with id response model that it extends so that the id property is generically typed and type can be passed in.

This commit is contained in:
Stevan Freeborn
2023-02-17 14:27:33 -06:00
parent 369540d3c8
commit bc8b9a4977
10 changed files with 148 additions and 32 deletions
+3 -3
View File
@@ -264,11 +264,11 @@ export class OnspringClient {
/**
* @method saveFile - Saves a file to a record in Onspring.
* @param {SaveFileRequest} request - The request that will be used to save the file.
* @returns {Promise<ApiResponse<CreatedWithIdResponse>>} - A promise that resolves to an ApiResponse of type CreatedWithIdResponse.
* @returns {Promise<ApiResponse<CreatedWithIdResponse<number>>>} - A promise that resolves to an ApiResponse of type CreatedWithIdResponse.
*/
public async saveFile(
request: SaveFileRequest
): Promise<ApiResponse<CreatedWithIdResponse>> {
): Promise<ApiResponse<CreatedWithIdResponse<number>>> {
const endpoint = EndpointFactory.getSaveFileEndpoint();
const formData = request.asFormData();
const apiResponse = await this.post<any>(endpoint, formData, {
@@ -279,7 +279,7 @@ export class OnspringClient {
return apiResponse;
}
return apiResponse.asCreatedWithIdResponseType();
return apiResponse.asCreatedWithIdResponseType<number>();
}
public async deleteFileById(