Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting foreign keys which reference non-primary keys #144

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin_ui/src/components/RowFormSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}"
class="add"
target="_blank"
v-if="!isFilter"
v-if="!isFilter && getKeySelectID(property.title)"
>
<font-awesome-icon icon="edit" />
</router-link>
Expand Down
4 changes: 2 additions & 2 deletions admin_ui/src/views/RowListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@
<span
class="link"
v-else-if="
isForeignKey(name) & (row[name] !== null)
isForeignKey(name) & (row[pkName] !== null)
"
>
<router-link
:to="{
name: 'editRow',
params: {
tableName: getTableName(name),
rowID: row[name]
rowID: row[pkName]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thought so before, but the rowID: row[pkName] is the primary key of the Review table, not Review.movie.id.
I wrote in the comment the changes I think we need to make in Piccolo API to get correct results.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - it took a while for me to realise this. My solution doesn't work.

}
}"
>{{ row[name + "_readable"] }}</router-link
Expand Down