diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-12-30 12:52:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-30 10:52:50 +0000 |
| commit | a0b4a26ad398137e13c35f3fe0dad99154537d91 (patch) | |
| tree | 6e7f7b8acb7725717fdbb06ad262a122cdd2dfd5 /packages/trpc/routers | |
| parent | 7ab7db8e48360417498643eec2384b0fcb7fbdfb (diff) | |
| download | karakeep-a0b4a26ad398137e13c35f3fe0dad99154537d91.tar.zst | |
feat: 2025 wrapped (#2322)
* feat: 2025 wrapped
* don't add wrapped for new users
Diffstat (limited to 'packages/trpc/routers')
| -rw-r--r-- | packages/trpc/routers/users.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/trpc/routers/users.ts b/packages/trpc/routers/users.ts index dbfbbc3c..71c23a39 100644 --- a/packages/trpc/routers/users.ts +++ b/packages/trpc/routers/users.ts @@ -9,6 +9,7 @@ import { zUserSettingsSchema, zUserStatsResponseSchema, zWhoAmIResponseSchema, + zWrappedStatsResponseSchema, } from "@karakeep/shared/types/users"; import { @@ -136,6 +137,16 @@ export const usersAppRouter = router({ const user = await User.fromCtx(ctx); return await user.getStats(); }), + wrapped: authedProcedure + .output(zWrappedStatsResponseSchema) + .query(async ({ ctx }) => { + const user = await User.fromCtx(ctx); + return await user.getWrappedStats(2025); + }), + hasWrapped: authedProcedure.output(z.boolean()).query(async ({ ctx }) => { + const user = await User.fromCtx(ctx); + return await user.hasWrapped(); + }), settings: authedProcedure .output(zUserSettingsSchema) .query(async ({ ctx }) => { |
