Skip to content

Commit

Permalink
Return only the data from getRecords id query.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Feb 13, 2023
1 parent 7c2f7e9 commit e61e86c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/field-kit/src/entities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export default function useEntities(options = {}) {
const { queue, state, transactions } = revision;
queue.push(() => {
updateStatus(STATUS_IN_PROGRESS);
return getRecords('entities', _entity, id).then(([, data]) => {
return getRecords('entities', _entity, id).then((data) => {
if (data) emit(state, data);
const syncOptions = { cache: asArray(data), filter: { id, type } };
return syncEntities(shortName, syncOptions)
Expand Down
2 changes: 1 addition & 1 deletion packages/field-kit/src/idb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function getRecords(dbName, storeName, query) {
if (typeof query === 'function') {
return cursorQuery(store, query);
}
return getOneByPrimaryKey(query);
return getOneByPrimaryKey(query).then(([, data]) => data);
});
}

Expand Down

0 comments on commit e61e86c

Please sign in to comment.