Files
spliit/src/trpc/routers/groups/expenses/delete.procedure.ts
Sebastien Castiel c1c75fa260 Q: Why do mountain climbers rope themselves together?
A:	To prevent the sensible ones from going home.
2024-10-25 15:02:31 -04:00

17 lines
483 B
TypeScript

import { z } from 'zod'
import { deleteExpense } from '../../../../lib/api'
import { baseProcedure } from '../../../init'
export const deleteGroupExpenseProcedure = baseProcedure
.input(
z.object({
expenseId: z.string().min(1),
groupId: z.string().min(1),
participantId: z.string().optional(),
}),
)
.mutation(async ({ input: { expenseId, groupId, participantId } }) => {
await deleteExpense(groupId, expenseId, participantId)
return {}
})