@@ -37,16 +37,28 @@ export default class ResponseWrapper {
3737
3838 items : this . api . items . bind ( this . api , { collectionId : collection . _id } ) ,
3939 item ( first , ...rest ) {
40- return this . api . item ( { ...first , collectionId : collection . _id } , ...rest ) ;
40+ return this . api . item (
41+ { ...first , collectionId : collection . _id } ,
42+ ...rest
43+ ) ;
4144 } ,
4245 createItem ( first , ...rest ) {
43- return this . api . createItem ( { ...first , collectionId : collection . _id } , ...rest ) ;
46+ return this . api . createItem (
47+ { ...first , collectionId : collection . _id } ,
48+ ...rest
49+ ) ;
4450 } ,
4551 updateItem ( first , ...rest ) {
46- return this . api . updateItem ( { ...first , collectionId : collection . _id } , ...rest ) ;
52+ return this . api . updateItem (
53+ { ...first , collectionId : collection . _id } ,
54+ ...rest
55+ ) ;
4756 } ,
4857 removeItem ( first , ...rest ) {
49- return this . api . removeItem ( { ...first , collectionId : collection . _id } , ...rest ) ;
58+ return this . api . removeItem (
59+ { ...first , collectionId : collection . _id } ,
60+ ...rest
61+ ) ;
5062 } ,
5163 } ;
5264 }
@@ -56,17 +68,39 @@ export default class ResponseWrapper {
5668 ...item ,
5769
5870 update ( first , ...rest ) {
59- return this . api . updateItem ( { ...first , collectionId, itemId : item . _id } , ...rest ) ;
71+ return this . api . updateItem (
72+ { ...first , collectionId, itemId : item . _id } ,
73+ ...rest
74+ ) ;
75+ } ,
76+ remove : this . api . updateItem . bind ( this . api , {
77+ collectionId,
78+ itemId : item . _id ,
79+ } ) ,
80+ } ;
81+ }
82+
83+ user ( user , siteId ) {
84+ return {
85+ ...user ,
86+
87+ update ( first , ...rest ) {
88+ return this . api . updateUser ( { ...first , siteId } , ...rest ) ;
89+ } ,
90+ remove ( first , ...rest ) {
91+ return this . api . removeUser ( { ...first , siteId } , ...rest ) ;
6092 } ,
61- remove : this . api . updateItem . bind ( this . api , { collectionId, itemId : item . _id } ) ,
6293 } ;
6394 }
6495
6596 webhook ( webhook , siteId ) {
6697 return {
6798 ...webhook ,
6899
69- remove : this . api . removeWebhook . bind ( this . api , { siteId, webhookId : webhook . _id } ) ,
100+ remove : this . api . removeWebhook . bind ( this . api , {
101+ siteId,
102+ webhookId : webhook . _id ,
103+ } ) ,
70104 } ;
71105 }
72106}
0 commit comments