feat: add integration tests for deleteRecordById method. fix: add toJSON method on SaveRecordRequest model to handle converting fields map to a POJO before sending in request
This commit is contained in:
@@ -425,7 +425,7 @@ export class OnspringClient {
|
||||
: request;
|
||||
|
||||
const endpoint = EndpointFactory.getAddOrUpdateRecordEndpoint();
|
||||
const apiResponse = await this.put<any>(endpoint, request);
|
||||
const apiResponse = await this.put<any>(endpoint, request.toJSON());
|
||||
|
||||
if (apiResponse.isSuccessful === false) {
|
||||
return apiResponse;
|
||||
|
||||
@@ -25,4 +25,12 @@ export class SaveRecordRequest {
|
||||
this.recordId = recordId;
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public toJSON(): any {
|
||||
return {
|
||||
appId: this.appId,
|
||||
recordId: this.recordId,
|
||||
fields: Object.fromEntries(this.fields),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user