fix(settings): spec compliance gaps in My Profile tab
- add POST /api/settings/resume/sync-identity endpoint (IdentitySyncPayload) - fix loadError destructuring to use storeToRefs for reactivity
This commit is contained in:
parent
86454a97be
commit
2937c1b0fa
2 changed files with 20 additions and 1 deletions
18
dev-api.py
18
dev-api.py
|
|
@ -974,6 +974,24 @@ class UserProfilePayload(BaseModel):
|
|||
lgbtq_focus: bool = False
|
||||
|
||||
|
||||
class IdentitySyncPayload(BaseModel):
|
||||
name: str = ""
|
||||
email: str = ""
|
||||
phone: str = ""
|
||||
linkedin_url: str = ""
|
||||
|
||||
@app.post("/api/settings/resume/sync-identity")
|
||||
def sync_identity(payload: IdentitySyncPayload):
|
||||
"""Sync identity fields from profile store back to user.yaml."""
|
||||
data = load_user_profile(_user_yaml_path())
|
||||
data["name"] = payload.name
|
||||
data["email"] = payload.email
|
||||
data["phone"] = payload.phone
|
||||
data["linkedin"] = payload.linkedin_url # yaml key is 'linkedin', not 'linkedin_url'
|
||||
save_user_profile(_user_yaml_path(), data)
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
@app.put("/api/settings/profile")
|
||||
def save_profile(payload: UserProfilePayload):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -198,12 +198,13 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useProfileStore } from '../../stores/settings/profile'
|
||||
import { useAppConfigStore } from '../../stores/appConfig'
|
||||
import { useApiFetch } from '../../composables/useApi'
|
||||
|
||||
const store = useProfileStore()
|
||||
const { loadError } = store
|
||||
const { loadError } = storeToRefs(store)
|
||||
const config = useAppConfigStore()
|
||||
|
||||
const newNdaCompany = ref('')
|
||||
|
|
|
|||
Loading…
Reference in a new issue