File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
lib/osf-components/addon/components/addons-service/manager Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ export default class AddonsServiceManagerComponent extends Component<Args> {
256256 if ( this . selectedProvider ) {
257257 const newAccount = await taskFor ( this . createAuthorizedAccount ) . perform ( arg ) ;
258258 if ( newAccount ) {
259- await taskFor ( this . createConfiguredAddon ) . perform ( newAccount ) ;
259+ this . selectedAccount = newAccount ;
260260 this . pageMode = PageMode . CONFIGURE ;
261261 }
262262 }
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ export interface MirageAddonOperationInvocation extends AddonOperationInvocation
2323
2424export default class AddonOperationInvocationSerializer extends AddonServiceSerializer < MirageAddonOperationInvocation > {
2525 buildRelationships ( model : ModelInstance < MirageAddonOperationInvocation > ) {
26- const thruAddonType = model . thruAddonId . type ;
27- return {
26+ const relationships = {
2827 byUser : {
2928 links : {
3029 related : {
@@ -36,7 +35,23 @@ export default class AddonOperationInvocationSerializer extends AddonServiceSeri
3635 id : model . byUserId ,
3736 } ,
3837 } ,
39- thruAddon : {
38+ } ;
39+ if ( model . thruAccountId ) {
40+ const thruAccountType = model . thruAccountId . type ;
41+ relationships . thruAccount = {
42+ links : {
43+ related : {
44+ href : `${ addonServiceAPIUrl } ${ thruAccountType } /${ model . thruAccountId } /` ,
45+ } ,
46+ } ,
47+ data : {
48+ type : thruAccountType ,
49+ id : model . thruAccountId ,
50+ } ,
51+ } ;
52+ } else {
53+ const thruAddonType = model . thruAddonId . type ;
54+ relationships . thruAddon = {
4055 links : {
4156 related : {
4257 href : `${ addonServiceAPIUrl } ${ thruAddonType } /${ model . thruAddonId } /` ,
@@ -46,7 +61,8 @@ export default class AddonOperationInvocationSerializer extends AddonServiceSeri
4661 type : thruAddonType ,
4762 id : model . thruAddonId ,
4863 } ,
49- } ,
50- } ;
64+ } ;
65+ }
66+ return relationships ;
5167 }
5268}
You can’t perform that action at this time.
0 commit comments