mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-09-30 06:12:26 -05:00
Check for undefined on latest_webhook_timestamp
Not all accounts are guaranteed to have this field, so we have to check if it exists. If it doesn't, just set the value to 0.
This commit is contained in:
@@ -38,9 +38,9 @@ export async function getUserData(_request: Empty, context: CallContext & Authen
|
||||
priceId: pnid.connections.stripe.price_id,
|
||||
tierLevel: pnid.connections.stripe.tier_level,
|
||||
tierName: pnid.connections.stripe.tier_name,
|
||||
latestWebhookTimestamp: BigInt(pnid.connections.stripe.latest_webhook_timestamp)
|
||||
latestWebhookTimestamp: BigInt(pnid.connections.stripe.latest_webhook_timestamp ?? 0)
|
||||
}
|
||||
},
|
||||
marketingFlag: pnid.flags.marketing
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ export async function updateUserData(_request: UpdateUserDataRequest, context: C
|
||||
priceId: pnid.connections.stripe.price_id,
|
||||
tierLevel: pnid.connections.stripe.tier_level,
|
||||
tierName: pnid.connections.stripe.tier_name,
|
||||
latestWebhookTimestamp: BigInt(pnid.connections.stripe.latest_webhook_timestamp)
|
||||
latestWebhookTimestamp: BigInt(pnid.connections.stripe.latest_webhook_timestamp ?? 0)
|
||||
}
|
||||
},
|
||||
marketingFlag: pnid.flags.marketing
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user