parse incoming JSON date strings as Date objects (#500)

* parse incoming JSON date strings as Date objects

* update create command too
This commit is contained in:
Kyle Spearrin 2022-03-04 09:47:46 -05:00 committed by GitHub
parent f1c1ab38ad
commit 2295cd3266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,8 @@ export class SendCreateCommand {
if (typeof requestJson !== "string") {
req = requestJson;
req.deletionDate = req.deletionDate == null ? null : new Date(req.deletionDate);
req.expirationDate = req.expirationDate == null ? null : new Date(req.expirationDate);
} else {
try {
const reqJson = Buffer.from(requestJson, "base64").toString();

View File

@ -27,6 +27,8 @@ export class SendEditCommand {
let req: SendResponse = null;
if (typeof requestJson !== "string") {
req = requestJson;
req.deletionDate = req.deletionDate == null ? null : new Date(req.deletionDate);
req.expirationDate = req.expirationDate == null ? null : new Date(req.expirationDate);
} else {
try {
const reqJson = Buffer.from(requestJson, "base64").toString();