WIP - fix lookup field
This commit is contained in:
@@ -19,11 +19,11 @@ interface Props {
|
||||
config: RelatedListConfig
|
||||
parentId: string
|
||||
relatedRecords?: any[] // Can be passed in if already fetched
|
||||
baseUrl?: string // Base API URL, defaults to '/api/central'
|
||||
baseUrl?: string // Base API URL, defaults to '/central'
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
baseUrl: '/api/central',
|
||||
baseUrl: '/central',
|
||||
relatedRecords: undefined,
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ const emit = defineEmits<{
|
||||
'create': [objectApiName: string, parentId: string]
|
||||
}>()
|
||||
|
||||
const { $api } = useNuxtApp() as unknown as { $api: Function }
|
||||
const { api } = useApi()
|
||||
const records = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
@@ -52,7 +52,7 @@ const fetchRelatedRecords = async () => {
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
const response = await $api(`${props.baseUrl}/${props.config.objectApiName}`, {
|
||||
const response = await api.get(`${props.baseUrl}/${props.config.objectApiName}`, {
|
||||
params: {
|
||||
parentId: props.parentId,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user