feat(subscription): ProfileTab에 5티어/알림 설정 통합
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@ import React, { useState, useEffect, useMemo, useCallback } from 'react';
|
|||||||
import { apiGet, apiPost, apiPut, apiDelete } from '../../api';
|
import { apiGet, apiPost, apiPut, apiDelete } from '../../api';
|
||||||
import PullToRefresh from '../../components/PullToRefresh';
|
import PullToRefresh from '../../components/PullToRefresh';
|
||||||
import FAB from '../../components/FAB';
|
import FAB from '../../components/FAB';
|
||||||
|
import DistrictTierEditor from './components/DistrictTierEditor';
|
||||||
|
import NotificationSettings from './components/NotificationSettings';
|
||||||
import './Subscription.css';
|
import './Subscription.css';
|
||||||
|
|
||||||
// ── 상수 ───────────────────────────────────────────────────────────────────────
|
// ── 상수 ───────────────────────────────────────────────────────────────────────
|
||||||
@@ -1027,6 +1029,13 @@ function ProfileTab() {
|
|||||||
if (payload.preferred_regions.length === 0) payload.preferred_regions = null;
|
if (payload.preferred_regions.length === 0) payload.preferred_regions = null;
|
||||||
if (payload.preferred_types.length === 0) payload.preferred_types = null;
|
if (payload.preferred_types.length === 0) payload.preferred_types = null;
|
||||||
|
|
||||||
|
// 신규: preferred_districts (객체), min_match_score, notify_enabled
|
||||||
|
payload.preferred_districts = profile.preferred_districts && typeof profile.preferred_districts === "object"
|
||||||
|
? profile.preferred_districts
|
||||||
|
: {};
|
||||||
|
payload.min_match_score = profile.min_match_score ?? null;
|
||||||
|
payload.notify_enabled = profile.notify_enabled ?? null;
|
||||||
|
|
||||||
const updated = await apiPut('/api/realestate/profile', payload);
|
const updated = await apiPut('/api/realestate/profile', payload);
|
||||||
if (updated && Object.keys(updated).length > 0) {
|
if (updated && Object.keys(updated).length > 0) {
|
||||||
// Convert arrays back to comma-separated strings for display
|
// Convert arrays back to comma-separated strings for display
|
||||||
@@ -1304,6 +1313,19 @@ function ProfileTab() {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 자치구 5티어 */}
|
||||||
|
<DistrictTierEditor
|
||||||
|
value={profile.preferred_districts}
|
||||||
|
onChange={(next) => setProfile(prev => ({ ...prev, preferred_districts: next }))}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* 알림 설정 */}
|
||||||
|
<NotificationSettings
|
||||||
|
minScore={profile.min_match_score ?? 70}
|
||||||
|
notifyEnabled={profile.notify_enabled ?? true}
|
||||||
|
onChange={(patch) => setProfile(prev => ({ ...prev, ...patch }))}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user