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:
parent
f1c1ab38ad
commit
2295cd3266
|
@ -31,6 +31,8 @@ export class SendCreateCommand {
|
||||||
|
|
||||||
if (typeof requestJson !== "string") {
|
if (typeof requestJson !== "string") {
|
||||||
req = requestJson;
|
req = requestJson;
|
||||||
|
req.deletionDate = req.deletionDate == null ? null : new Date(req.deletionDate);
|
||||||
|
req.expirationDate = req.expirationDate == null ? null : new Date(req.expirationDate);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
const reqJson = Buffer.from(requestJson, "base64").toString();
|
const reqJson = Buffer.from(requestJson, "base64").toString();
|
||||||
|
|
|
@ -27,6 +27,8 @@ export class SendEditCommand {
|
||||||
let req: SendResponse = null;
|
let req: SendResponse = null;
|
||||||
if (typeof requestJson !== "string") {
|
if (typeof requestJson !== "string") {
|
||||||
req = requestJson;
|
req = requestJson;
|
||||||
|
req.deletionDate = req.deletionDate == null ? null : new Date(req.deletionDate);
|
||||||
|
req.expirationDate = req.expirationDate == null ? null : new Date(req.expirationDate);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
const reqJson = Buffer.from(requestJson, "base64").toString();
|
const reqJson = Buffer.from(requestJson, "base64").toString();
|
||||||
|
|
Loading…
Reference in New Issue