When parsing Send request object JSON, date fields will be received as strings. The SendResponse object expects them to be Date objects. This is manually handled when parsing the JSON in SendResponse.fromJson(), however, since Koa.js parses the JSON string into an object for us when using serve, we need to manually correct this.
Ideally, we need to move away from the SendResponse object for sends. It seems this object has been abused and is not appropriate for CLI request objects.
Code changes
send/edit.command.ts: Parse date strings as Date objects.
send/create.command.ts: Parse date strings as Date objects.
Type of change
Objective
When parsing Send request object JSON, date fields will be received as strings. The SendResponse object expects them to be Date objects. This is manually handled when parsing the JSON in SendResponse.fromJson(), however, since Koa.js parses the JSON string into an object for us when using serve, we need to manually correct this.
Ideally, we need to move away from the SendResponse object for sends. It seems this object has been abused and is not appropriate for CLI request objects.
Code changes
Testing requirements
Repeat test procedures from https://app.asana.com/0/1153294014282570/1201747502562147
Before you submit
npm run lint
) (required)