mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-19 22:16:13 +01:00
* Use tRPC for recent groups page * Use tRPC for adding group by URL * Use tRPC for saving visited group * Group context
11 lines
317 B
TypeScript
11 lines
317 B
TypeScript
import { getGroup } from '@/lib/api'
|
|
import { baseProcedure } from '@/trpc/init'
|
|
import { z } from 'zod'
|
|
|
|
export const getGroupProcedure = baseProcedure
|
|
.input(z.object({ groupId: z.string().min(1) }))
|
|
.query(async ({ input: { groupId } }) => {
|
|
const group = await getGroup(groupId)
|
|
return { group }
|
|
})
|