mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-09 05:39:06 +01:00
Use tRPC for expense form (#251)
This commit is contained in:
committed by
GitHub
parent
2281316d58
commit
21d0c02687
16
src/trpc/routers/groups/expenses/delete.procedure.ts
Normal file
16
src/trpc/routers/groups/expenses/delete.procedure.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { deleteExpense } from '@/lib/api'
|
||||
import { baseProcedure } from '@/trpc/init'
|
||||
import { z } from 'zod'
|
||||
|
||||
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 {}
|
||||
})
|
||||
Reference in New Issue
Block a user