File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @labdigital/commercetools-mock " : patch
3+ ---
4+
5+ properly fetch the business unit key in getBusinessUnitKeyReference
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import type {
1010 AssociateRoleResourceIdentifier ,
1111 BaseAddress ,
1212 BusinessUnitKeyReference ,
13- BusinessUnitReference ,
1413 BusinessUnitResourceIdentifier ,
1514 CentPrecisionMoney ,
1615 CustomFields ,
@@ -323,18 +322,17 @@ export const getBusinessUnitKeyReference = (
323322 } ;
324323 }
325324
326- const value = getReferenceFromResourceIdentifier < BusinessUnitReference > (
327- id ,
325+ const resource = storage . getByResourceIdentifier < "business-unit" > (
328326 projectKey ,
329- storage ,
327+ id ,
330328 ) ;
331329
332- if ( ! value . obj ?. key ) {
330+ if ( ! resource ?. key ) {
333331 throw new Error ( "No business-unit found for reference" ) ;
334332 }
335333
336334 return {
337335 typeId : "business-unit" ,
338- key : value . obj ? .key ,
336+ key : resource . key ,
339337 } ;
340338} ;
You can’t perform that action at this time.
0 commit comments