Fix: EventType Duplication (#6778)
parent
6c23813192
commit
8cf0050d1f
|
@ -676,7 +676,13 @@ export const eventTypesRouter = router({
|
|||
}),
|
||||
duplicate: eventOwnerProcedure.input(EventTypeDuplicateInput.strict()).mutation(async ({ ctx, input }) => {
|
||||
try {
|
||||
const { id: originalEventTypeId, title: newEventTitle, slug: newSlug } = input;
|
||||
const {
|
||||
id: originalEventTypeId,
|
||||
title: newEventTitle,
|
||||
slug: newSlug,
|
||||
description: newDescription,
|
||||
length: newLength,
|
||||
} = input;
|
||||
const eventType = await ctx.prisma.eventType.findUnique({
|
||||
where: {
|
||||
id: originalEventTypeId,
|
||||
|
@ -735,6 +741,8 @@ export const eventTypesRouter = router({
|
|||
...rest,
|
||||
title: newEventTitle,
|
||||
slug: newSlug,
|
||||
description: newDescription,
|
||||
length: newLength,
|
||||
locations: locations ?? undefined,
|
||||
teamId: team ? team.id : undefined,
|
||||
users: users ? { connect: users.map((user) => ({ id: user.id })) } : undefined,
|
||||
|
|
Loading…
Reference in New Issue