Skip to content

Commit

Permalink
Merge pull request #57 from rezo-labs/fix/o2m
Browse files Browse the repository at this point in the history
Fix O2M bug of v1.8.1
  • Loading branch information
duydvu committed Aug 19, 2023
2 parents 103eb64 + 7268789 commit e125f7d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "directus-extension-computed-interface",
"version": "1.8.1",
"version": "1.8.2",
"description": "Perform computed value based on other fields",
"author": {
"email": "duydvu98@gmail.com",
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const useDeepValues = (
}

let relationalData: Record<string, any> = {};
const pkFinal = valObj.id || pk;
const pkFinal = valObj.id || pk.value;

for (const key of Object.keys(valObj)) {
const relation = relations.value.find((rel) => [rel.meta?.one_field, rel.meta?.many_field].includes(key));
Expand Down Expand Up @@ -135,7 +135,7 @@ export const useDeepValues = (
if (key in fieldCache) {
data = fieldCache[key];
} else {
data = (await api.get(`items/${collection}/${pkFinal}`, {
data = (await api.get(`items/${collection.value}/${pkFinal}`, {
params: {
fields: [key],
},
Expand Down

0 comments on commit e125f7d

Please sign in to comment.