File tree Expand file tree Collapse file tree 2 files changed +21
-35
lines changed
Expand file tree Collapse file tree 2 files changed +21
-35
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -43,11 +43,26 @@ export default Model.extend({
4343 follow : memberAction ( { type : 'PUT' , path : 'follow' } ) ,
4444 unfollow : memberAction ( { type : 'DELETE' , path : 'follow' } ) ,
4545
46- inviteOwner ( username ) {
47- return this . store . adapterFor ( 'crate' ) . inviteOwner ( this . id , username ) ;
48- } ,
46+ inviteOwner : memberAction ( {
47+ type : 'PUT' ,
48+ path : 'owners' ,
49+ before ( username ) {
50+ return { owners : [ username ] } ;
51+ } ,
52+ after ( response ) {
53+ if ( response . ok ) {
54+ return response ;
55+ } else {
56+ throw response ;
57+ }
58+ } ,
59+ } ) ,
4960
50- removeOwner ( username ) {
51- return this . store . adapterFor ( 'crate' ) . removeOwner ( this . id , username ) ;
52- } ,
61+ removeOwner : memberAction ( {
62+ type : 'DELETE' ,
63+ path : 'owners' ,
64+ before ( username ) {
65+ return { owners : [ username ] } ;
66+ } ,
67+ } ) ,
5368} ) ;
You can’t perform that action at this time.
0 commit comments