1
0
forked from baron/baron-sso

dev 병합 code-check 오류 수정

This commit is contained in:
2026-05-08 15:04:40 +09:00
parent 59cb482219
commit e78b2bea50
8 changed files with 144 additions and 28 deletions

View File

@@ -123,6 +123,7 @@ function createEmptyAppointment(): AppointmentDraft {
tenantId: "",
tenantName: "",
tenantSlug: "",
isPrimary: false,
isOwner: false,
jobTitle: "",
position: "",
@@ -554,6 +555,15 @@ function UserDetailPage() {
);
};
const setPrimaryAppointment = (targetIndex: number) => {
setAdditionalAppointments((current) =>
current.map((appointment, index) => ({
...appointment,
isPrimary: index === targetIndex,
})),
);
};
const handleUserTypeChange = (value: string) => {
const nextType = value as UserType;
setUserType(nextType);
@@ -645,6 +655,9 @@ function UserDetailPage() {
Array.isArray(rawAppointments)
? (rawAppointments as UserAppointment[]).map((appointment) => ({
...appointment,
isPrimary:
appointment.isPrimary === true ||
appointment.tenantId === primaryFromMetadata?.id,
draftId: createDraftId(),
}))
: isUserHanmacFamily
@@ -654,6 +667,7 @@ function UserDetailPage() {
tenantId: tenant.id,
tenantName: tenant.name,
tenantSlug: tenant.slug,
isPrimary: tenant.id === fallbackAppointment?.id,
isOwner:
metadata.primaryTenantIsOwner === true &&
tenant.id === fallbackAppointment?.id,
@@ -667,6 +681,7 @@ function UserDetailPage() {
tenantId: fallbackAppointment.id,
tenantName: fallbackAppointment.name,
tenantSlug: fallbackAppointment.slug,
isPrimary: true,
isOwner: metadata.primaryTenantIsOwner === true,
jobTitle: user.jobTitle,
position: user.position,
@@ -781,7 +796,15 @@ function UserDetailPage() {
payload.metadata = {
...metadata,
additionalAppointments: appointments,
primaryTenantId: primaryAppointment?.tenantId,
primaryTenantName: primaryAppointment?.tenantName,
primaryTenantSlug: primaryAppointment?.tenantSlug,
primaryTenantIsOwner: primaryAppointment?.isOwner ?? false,
};
payload.tenantSlug = primaryAppointment?.tenantSlug;
payload.primaryTenantId = primaryAppointment?.tenantId;
payload.primaryTenantName = primaryAppointment?.tenantName;
payload.primaryTenantIsOwner = primaryAppointment?.isOwner ?? false;
}
mutation.mutate(payload);