tangled
alpha
login
or
join now
openstatus.dev
/
openstatus
5
fork
atom
Openstatus
www.openstatus.dev
5
fork
atom
overview
issues
pulls
pipelines
fix: feature event
Maximilian Kaske
2 months ago
0936bc5b
3478aa59
+2
-7
2 changed files
expand all
collapse all
unified
split
packages
api
src
router
stripe
index.ts
webhook.ts
+2
packages/api/src/router/stripe/index.ts
···
9
9
workspacePlans,
10
10
} from "@openstatus/db/src/schema";
11
11
12
12
+
import { Events } from "@openstatus/analytics";
12
13
import { allPlans } from "@openstatus/db/src/schema/plan/config";
13
14
import { addons } from "@openstatus/db/src/schema/plan/schema";
14
15
import { updateAddonInLimits } from "@openstatus/db/src/schema/plan/utils";
···
173
174
}),
174
175
175
176
addAddon: protectedProcedure
177
177
+
.meta({ track: Events.AddFeature, trackProps: ["feature"] })
176
178
.input(
177
179
z.object({
178
180
workspaceSlug: z.string(),
-7
packages/api/src/router/stripe/webhook.ts
···
98
98
.where(eq(user.email, customer.email))
99
99
.get();
100
100
if (!userResult) return;
101
101
-
102
102
-
const analytics = await setupAnalytics({
103
103
-
userId: `usr_${userResult.id}`,
104
104
-
email: userResult.email || undefined,
105
105
-
workspaceId: String(result.id),
106
106
-
});
107
107
-
await analytics.track(Events.AddFeature);
108
101
}
109
102
}),
110
103
sessionCompleted: webhookProcedure.mutation(async (opts) => {