rowyio / rowy

Low-code backend platform. Manage database on spreadsheet-like UI and build cloud functions workflows in JS/TS, all in your browser.
http://rowy.io
Other
5.88k stars 479 forks source link

Sending Date using Webhook not working #1487

Closed abdoil closed 7 months ago

abdoil commented 9 months ago

Describe the bug i was trying to send data to rowy via webhook, all the other data are sent successfully except for Date, I tried sending as an object like this "posted":{"seconds":1681272000,"nanoseconds":0} and also in the format as yyyy-MM-dd. but still shows as blank. Here is a screenshot of how the data is

image

To Reproduce Trying by sending the date as object to Webhook

Expected behavior Nothing shows (Empty)

Rowy Run version Cloud Version

uudens commented 9 months ago

I was able to get it working using the Timestamp class.
Try to put something like this inside your webhook body:

const { default: { Timestamp } } = await import("@google-cloud/firestore");
const ts = Date.now();
return { posted: Timestamp.fromMillis(ts) };
Chadha93 commented 7 months ago

I was able to get it working using the Timestamp class. Try to put something like this inside your webhook body:

const { default: { Timestamp } } = await import("@google-cloud/firestore");
const ts = Date.now();
return { posted: Timestamp.fromMillis(ts) };

Thanks @uudens. @abdoil, You can follow the above approach to solve this, closing this issue. Thanks.