This commit is contained in:
Saahil 2025-02-07 23:07:21 -05:00
parent 1a6444e498
commit 13aa131493
No known key found for this signature in database
GPG key ID: 8A8B64515254CFC6
2 changed files with 5 additions and 2 deletions

View file

@ -40,6 +40,7 @@ export async function cron(app: ModifiedApp) {
// ),
// ]);
for (const moment of moments) {
console.log(moment.id)
const isPresent = await app.nocodb.dbViewRow.findOne(
"noco",
"p63yjsdax7yacy4",
@ -52,7 +53,8 @@ export async function cron(app: ModifiedApp) {
},
);
if (isPresent) continue;
if (!moment.description || !moment.video) continue;
if (!moment.description && !moment.video) continue;
console.log(1)
// insert into db
await app.nocodb.dbViewRow.create(
`noco`,
@ -61,7 +63,7 @@ export async function cron(app: ModifiedApp) {
"vwkxqq24oc49spbq",
{
airtable_id: moment.id,
description: moment.description,
description: moment.description || "No desc",
video_url: moment.video,
airtable_created_at: moment.created_at,
kudos: moment.kudos,

View file

@ -213,6 +213,7 @@ export function getShipmentDiff(
export function setupCronForShipments(app: ModifiedApp) {
new Cron("*/10 * * * *", async () => {
//@ts-ignore
const allUsersWithAShipmentURL = Object.keys(app.db.JSON()).filter((e) =>
e.startsWith(`shipment_url_`),
);