mirror of
https://github.com/bitwarden/cli
synced 2025-12-06 04:23:19 +00:00
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:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user