Skip to content

Commit beddfbb

Browse files
AstaldosPetr Kachanovsky
andauthored
fix: correct foreign resource as primary key linking (#81)
Co-authored-by: Petr Kachanovsky <[email protected]>
1 parent 736b29a commit beddfbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adminforth/spa/src/views/ListView.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ async function getList() {
197197
return {error: data.error};
198198
}
199199
rows.value = data.data?.map(row => {
200-
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey).name];
200+
if (coreStore.resource.columns.find(c => c.primaryKey).foreignResource) {
201+
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey).name].pk;
202+
} else {
203+
row._primaryKeyValue = row[coreStore.resource.columns.find(c => c.primaryKey).name];
204+
}
201205
return row;
202206
});
203207
totalRows.value = data.total;

0 commit comments

Comments
 (0)