feat(SPA): media field type
This commit is contained in:
1 parent
a2d596f4ca
commit
3e7fc9a4a5
57 files changed
+6109
-75
No files matched your search
@@ -5,6 +5,7 @@ import { useEntries } from '@/composables/useEntries'
|
||||
import { useEntryForm } from '@/composables/useEntryForm'
|
||||
import { useEntryLoad } from '@/composables/useEntryLoad'
|
||||
import type { ContentEntry } from '@/lib/contentTypes'
|
||||
import type { MediaSummary } from '@/lib/mediaField'
|
||||
import { resolveEditorPhase, type EntryTarget } from '@/lib/entryEditorState'
|
||||
import { buildData, issueFor, validateEntry } from '@/lib/entryForm'
|
||||
import { classifyRefusal, isGoneError, parseEntryRefusal } from '@/lib/entryServerError'
|
||||
@@ -91,7 +92,7 @@ export function useEntryDraft(typeKey: string, target: EntryTarget) {
|
||||
return null
|
||||
}
|
||||
failure.value = 'none'
|
||||
const issues = validateEntry(fields.value, form.values.value)
|
||||
const issues = validateEntry(fields.value, form.values.value, form.images.value)
|
||||
if (Object.keys(issues).length > 0) {
|
||||
form.reject(issues)
|
||||
focusToken.value++
|
||||
@@ -113,8 +114,8 @@ export function useEntryDraft(typeKey: string, target: EntryTarget) {
|
||||
}
|
||||
}
|
||||
|
||||
function change(key: string, value: unknown) {
|
||||
form.setValue(key, value)
|
||||
function change(key: string, value: unknown, image?: MediaSummary | null) {
|
||||
form.setValue(key, value, image)
|
||||
}
|
||||
|
||||
function reload() {
|
||||
|
||||
Reference in new issue
Block a user