WIP - remove console logs
This commit is contained in:
@@ -213,8 +213,6 @@ export const useViewState = <T extends { id?: string }>(
|
|||||||
const response = await api.get(`${apiEndpoint}/${id}`)
|
const response = await api.get(`${apiEndpoint}/${id}`)
|
||||||
// Handle response - data might be directly in response or in response.data
|
// Handle response - data might be directly in response or in response.data
|
||||||
currentRecord.value = response.data || response
|
currentRecord.value = response.data || response
|
||||||
console.log('[fetchRecord] Fetched record:', JSON.stringify(currentRecord.value, null, 2))
|
|
||||||
console.log('[fetchRecord] Record has id?', currentRecord.value?.id)
|
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
error.value = e.message
|
error.value = e.message
|
||||||
// Only log unexpected errors (not authorization failures)
|
// Only log unexpected errors (not authorization failures)
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ const detailConfig = computed(() => {
|
|||||||
const editConfig = computed(() => {
|
const editConfig = computed(() => {
|
||||||
if (!objectDefinition.value) return null
|
if (!objectDefinition.value) return null
|
||||||
const config = buildEditViewConfig(objectDefinition.value)
|
const config = buildEditViewConfig(objectDefinition.value)
|
||||||
console.log('[PAGE] editConfig computed:', config ? 'EXISTS' : 'NULL')
|
|
||||||
return config
|
return config
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -129,22 +128,9 @@ const editConfig = computed(() => {
|
|||||||
const canCreate = computed(() => {
|
const canCreate = computed(() => {
|
||||||
const publicCreate = objectAccess.value?.publicCreate
|
const publicCreate = objectAccess.value?.publicCreate
|
||||||
const result = publicCreate === true || publicCreate === 1
|
const result = publicCreate === true || publicCreate === 1
|
||||||
console.log('[PAGE] canCreate computed:', result, '(publicCreate:', publicCreate, 'type:', typeof publicCreate, ')')
|
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
// Debug current view state
|
|
||||||
watch([view, recordId, editConfig, currentRecord, loading, dataLoading], ([v, rid, ec, cr, l, dl]) => {
|
|
||||||
console.log('[PAGE] View state changed:')
|
|
||||||
console.log(' - view:', v)
|
|
||||||
console.log(' - recordId:', rid)
|
|
||||||
console.log(' - editConfig exists?', !!ec)
|
|
||||||
console.log(' - currentRecord exists?', !!cr)
|
|
||||||
console.log(' - loading:', l)
|
|
||||||
console.log(' - dataLoading:', dl)
|
|
||||||
console.log(' - Should show EditView?', (v === 'edit' || rid === 'new') && !!ec)
|
|
||||||
}, { immediate: true })
|
|
||||||
|
|
||||||
// Fetch object definition
|
// Fetch object definition
|
||||||
const fetchObjectDefinition = async () => {
|
const fetchObjectDefinition = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user