File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,12 @@ describe('Hooks', () => {
46
46
// Find
47
47
return Parse . Hooks . getFunction ( "My-Test-Function" )
48
48
} ) . then ( response => {
49
+ expect ( response . objectId ) . toBeUndefined ( ) ;
49
50
expect ( response . url ) . toBe ( "http://someurl" ) ;
50
51
return Parse . Hooks . updateFunction ( "My-Test-Function" , "http://anotherurl" ) ;
51
52
} )
52
53
. then ( ( res ) => {
54
+ expect ( res . objectId ) . toBeUndefined ( ) ;
53
55
expect ( res . functionName ) . toBe ( "My-Test-Function" ) ;
54
56
expect ( res . url ) . toBe ( "http://anotherurl" )
55
57
// delete
@@ -90,6 +92,7 @@ describe('Hooks', () => {
90
92
} ) . then ( ( res ) => {
91
93
expect ( res ) . not . toBe ( null ) ;
92
94
expect ( res ) . not . toBe ( undefined ) ;
95
+ expect ( res . objectId ) . toBeUndefined ( ) ;
93
96
expect ( res . url ) . toBe ( "http://someurl" ) ;
94
97
// delete
95
98
return Parse . Hooks . updateTrigger ( "MyClass" , "beforeDelete" , "http://anotherurl" ) ;
@@ -99,6 +102,7 @@ describe('Hooks', () => {
99
102
} ) . then ( ( res ) => {
100
103
expect ( res . className ) . toBe ( "MyClass" ) ;
101
104
expect ( res . url ) . toBe ( "http://anotherurl" )
105
+ expect ( res . objectId ) . toBeUndefined ( ) ;
102
106
103
107
return Parse . Hooks . deleteTrigger ( "MyClass" , "beforeDelete" ) ;
104
108
} , ( err ) => {
Original file line number Diff line number Diff line change @@ -57,7 +57,12 @@ export class HooksController {
57
57
58
58
_getHooks ( query = { } , limit ) {
59
59
let options = limit ? { limit : limit } : undefined ;
60
- return this . database . find ( DefaultHooksCollectionName , query ) ;
60
+ return this . database . find ( DefaultHooksCollectionName , query ) . then ( ( results ) => {
61
+ return results . map ( ( result ) => {
62
+ delete result . objectId ;
63
+ return result ;
64
+ } ) ;
65
+ } ) ;
61
66
}
62
67
63
68
_removeHooks ( query ) {
You can’t perform that action at this time.
0 commit comments