diff --git a/src/app/(dashboard)/customers/actions.ts b/src/app/(dashboard)/customers/actions.ts index 59497eb..d8fd025 100644 --- a/src/app/(dashboard)/customers/actions.ts +++ b/src/app/(dashboard)/customers/actions.ts @@ -117,9 +117,12 @@ export async function updateCustomer( where: { id }, select: { birthdayType: true }, }); - const data = toData(r.data); + const parsed = toData(r.data); // 改版前的阴历生日不能在保存其它字段时改成阳历,否则明年提醒日会错 - if (existing?.birthdayType === 2) data.birthdayType = 2; + const data = { + ...parsed, + birthdayType: existing?.birthdayType === 2 ? 2 : parsed.birthdayType, + }; await prisma.customer.update({ where: { id }, data }); revalidatePath("/customers");