fix(gateway): 이벤트 기수 0 저장을 허용
숫자 입력에서 Vue가 반환한 number 값을 안전하게 정규화해 다음 시즌 번호 0이 메타 저장 요청까지 전달되도록 수정한다. API 경계와 실제 Chromium payload 회귀 테스트를 추가한다.
This commit is contained in:
@@ -407,7 +407,7 @@ const profileEdits = ref<
|
||||
color: string;
|
||||
inGameNotice: string;
|
||||
profileImageUrl: string;
|
||||
nextSeasonIdx: string;
|
||||
nextSeasonIdx: string | number;
|
||||
localAccountAccessGraceDays: string;
|
||||
localAccountGeneralCreationGraceDays: string;
|
||||
resetDefaults: ProfileResetDefaults;
|
||||
@@ -770,7 +770,10 @@ const updateProfileMeta = async (profileName: string) => {
|
||||
if (!edit) {
|
||||
return;
|
||||
}
|
||||
const nextSeasonRaw = edit.nextSeasonIdx.trim();
|
||||
// Vue casts non-empty values from type="number" inputs to numbers even when
|
||||
// the buffer was initialized with a string. Normalize both runtime shapes so
|
||||
// event season 0 reaches the metadata mutation instead of throwing on trim().
|
||||
const nextSeasonRaw = String(edit.nextSeasonIdx).trim();
|
||||
const nextSeasonIdx = nextSeasonRaw === '' ? null : Number(nextSeasonRaw);
|
||||
if (nextSeasonIdx !== null && (!Number.isFinite(nextSeasonIdx) || nextSeasonIdx < 0)) {
|
||||
profileActionStatus.value = {
|
||||
@@ -2229,6 +2232,7 @@ onMounted(() => {
|
||||
type="number"
|
||||
min="0"
|
||||
step="1"
|
||||
data-testid="next-season-idx"
|
||||
class="w-full bg-zinc-950 border border-zinc-700 rounded px-3 py-2 text-sm text-white"
|
||||
placeholder="예: 12"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user