Fix linked record selector
This commit is contained in:
parent
3ddca769bb
commit
611793b32e
|
@ -9,7 +9,6 @@
|
||||||
export let schema
|
export let schema
|
||||||
export let linkedRecords = []
|
export let linkedRecords = []
|
||||||
|
|
||||||
|
|
||||||
$: label = capitalise(schema.name)
|
$: label = capitalise(schema.name)
|
||||||
$: linkedModelId = schema.modelId
|
$: linkedModelId = schema.modelId
|
||||||
$: linkedModel = $backendUiStore.models.find(
|
$: linkedModel = $backendUiStore.models.find(
|
||||||
|
@ -18,7 +17,7 @@
|
||||||
$: promise = fetchRecords(linkedModelId)
|
$: promise = fetchRecords(linkedModelId)
|
||||||
|
|
||||||
async function fetchRecords(linkedModelId) {
|
async function fetchRecords(linkedModelId) {
|
||||||
const FETCH_RECORDS_URL = `/api/${}/records`
|
const FETCH_RECORDS_URL = `/api/${linkedModelId}/records`
|
||||||
const response = await api.get(FETCH_RECORDS_URL)
|
const response = await api.get(FETCH_RECORDS_URL)
|
||||||
const result = await response.json()
|
const result = await response.json()
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
|
Loading…
Reference in New Issue