diff --git a/frontend/src/components/pricing/UpgradeDialog.vue b/frontend/src/components/pricing/UpgradeDialog.vue index 68160775..0ed5c409 100644 --- a/frontend/src/components/pricing/UpgradeDialog.vue +++ b/frontend/src/components/pricing/UpgradeDialog.vue @@ -634,14 +634,26 @@ export default { ) }, async init() { - // if (this.featureFlagsLoaded) { if (!this.lifetimePrice || !this.monthlyPrice) { await this.fetchPrice() } - // } }, async fetchPrice() { - const res = await get("/stripe/price?exp=" + this.pricingPageConversion) + let res; + // Mock stripe price results in development mode as the Stripe API won't be accessible + if (process.env.NODE_ENV === "development") { + res = { + lifetime: { id: "price_dev_lifetime", unit_amount: 9999, recurring: null }, + monthly: { id: "price_dev_monthly", unit_amount: 999, recurring: { interval: "month" } }, + yearly: { id: "price_dev_yearly", unit_amount: 7999, recurring: { interval: "year" } }, + lifetimeStudent: { id: "price_dev_lifetime_student", unit_amount: 4999, recurring: null }, + monthlyStudent: { id: "price_dev_monthly_student", unit_amount: 499, recurring: { interval: "month" } }, + yearlyStudent: { id: "price_dev_yearly_student", unit_amount: 3999, recurring: { interval: "year" } }, + } + } else { + res = await get("/stripe/price?exp=" + this.pricingPageConversion) + } + const { lifetime, monthly, diff --git a/server/routes/events.go b/server/routes/events.go index 16362df7..fbd5fb91 100644 --- a/server/routes/events.go +++ b/server/routes/events.go @@ -95,8 +95,13 @@ func createEvent(c *gin.Context) { var user *models.User var ownerId primitive.ObjectID if signedIn { - ownerId = utils.StringToObjectID(userId) user = db.GetUserById(userId) + if user == nil { + signedIn = false + ownerId = primitive.NilObjectID + } else { + ownerId = utils.StringToObjectID(userId) + } } else { ownerId = primitive.NilObjectID } @@ -686,8 +691,6 @@ func getResponses(c *gin.Context) { responsesMap[userId] = response } - - // Apply privacy logic based on blindAvailabilityEnabled if !utils.Coalesce(event.BlindAvailabilityEnabled) { // Blind availability is NOT enabled - return response as-is @@ -1628,4 +1631,3 @@ func getResponsesMap(responses []models.EventResponse) map[string]*models.Respon } return result } -