kin: KIN-067 При попытке сохранить настройки и синхронизироваться с обсидианом через настройки ошибка 'Sync error: Error: 400 Bad Request'. Разобраться с проблемой. Синхронизация работает в обе стороны.

This commit is contained in:
Gros Frumos 2026-03-16 08:38:49 +02:00
parent 81f974e6d3
commit 993362341b
5 changed files with 106 additions and 18 deletions

View file

@ -26,6 +26,7 @@ function initStatusFilter(): string[] {
}
const selectedStatuses = ref<string[]>(initStatusFilter())
const selectedCategory = ref('')
function toggleStatus(s: string) {
const idx = selectedStatuses.value.indexOf(s)
@ -119,9 +120,9 @@ async function applyAudit() {
// Add task modal
const TASK_CATEGORIES = ['SEC', 'UI', 'API', 'INFRA', 'BIZ', 'DB', 'ARCH', 'TEST', 'PERF', 'DOCS', 'FIX', 'OBS']
const CATEGORY_COLORS: Record<string, string> = {
SEC: 'red', UI: 'blue', API: 'green', INFRA: 'orange', BIZ: 'purple',
DB: 'yellow', ARCH: 'gray', TEST: 'purple', PERF: 'orange', DOCS: 'gray',
FIX: 'red', OBS: 'blue',
SEC: 'red', UI: 'purple', API: 'blue', INFRA: 'orange', BIZ: 'green',
DB: 'yellow', ARCH: 'indigo', TEST: 'cyan', PERF: 'pink', DOCS: 'gray',
FIX: 'rose', OBS: 'teal',
}
const showAddTask = ref(false)
const taskForm = ref({ title: '', priority: 5, route_type: '', category: '' })
@ -150,10 +151,17 @@ watch(selectedStatuses, (val) => {
onMounted(async () => { await load(); loadMode(); loadAutocommit() })
const taskCategories = computed(() => {
if (!project.value) return []
const cats = new Set(project.value.tasks.map(t => t.category).filter(Boolean) as string[])
return Array.from(cats).sort()
})
const filteredTasks = computed(() => {
if (!project.value) return []
let tasks = project.value.tasks
if (selectedStatuses.value.length > 0) tasks = tasks.filter(t => selectedStatuses.value.includes(t.status))
if (selectedCategory.value) tasks = tasks.filter(t => t.category === selectedCategory.value)
return tasks
})
@ -306,19 +314,20 @@ async function addDecision() {
<!-- Tasks Tab -->
<div v-if="activeTab === 'tasks'">
<div class="flex items-center justify-between mb-3">
<div class="flex gap-1 flex-wrap items-center">
<button v-for="s in ALL_TASK_STATUSES" :key="s"
:data-status="s"
@click="toggleStatus(s)"
class="px-2 py-0.5 text-xs rounded border transition-colors"
:class="selectedStatuses.includes(s)
? 'bg-blue-900/40 text-blue-300 border-blue-700'
: 'bg-gray-900 text-gray-600 border-gray-800 hover:text-gray-400 hover:border-gray-700'"
>{{ s }}</button>
<button v-if="selectedStatuses.length" data-action="clear-status" @click="clearStatusFilter"
class="px-1.5 py-0.5 text-xs text-gray-600 hover:text-red-400 rounded"></button>
</div>
<div class="flex flex-col gap-2 mb-3">
<div class="flex items-center justify-between">
<div class="flex gap-1 flex-wrap items-center">
<button v-for="s in ALL_TASK_STATUSES" :key="s"
:data-status="s"
@click="toggleStatus(s)"
class="px-2 py-0.5 text-xs rounded border transition-colors"
:class="selectedStatuses.includes(s)
? 'bg-blue-900/40 text-blue-300 border-blue-700'
: 'bg-gray-900 text-gray-600 border-gray-800 hover:text-gray-400 hover:border-gray-700'"
>{{ s }}</button>
<button v-if="selectedStatuses.length" data-action="clear-status" @click="clearStatusFilter"
class="px-1.5 py-0.5 text-xs text-gray-600 hover:text-red-400 rounded"></button>
</div>
<div class="flex gap-2">
<button @click="toggleMode"
class="px-2 py-1 text-xs border rounded transition-colors"

View file

@ -56,6 +56,7 @@ async function runSync(projectId: string) {
syncResults.value[projectId] = null
saveStatus.value[projectId] = ''
try {
await api.patchProject(projectId, { obsidian_vault_path: vaultPaths.value[projectId] })
syncResults.value[projectId] = await api.syncObsidian(projectId)
} catch (e) {
saveStatus.value[projectId] = `Sync error: ${e}`