File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,12 @@ describe('Hooks', () => {
4646 // Find
4747 return Parse . Hooks . getFunction ( "My-Test-Function" )
4848 } ) . then ( response => {
49+ expect ( response . objectId ) . toBeUndefined ( ) ;
4950 expect ( response . url ) . toBe ( "http://someurl" ) ;
5051 return Parse . Hooks . updateFunction ( "My-Test-Function" , "http://anotherurl" ) ;
5152 } )
5253 . then ( ( res ) => {
54+ expect ( res . objectId ) . toBeUndefined ( ) ;
5355 expect ( res . functionName ) . toBe ( "My-Test-Function" ) ;
5456 expect ( res . url ) . toBe ( "http://anotherurl" )
5557 // delete
@@ -90,6 +92,7 @@ describe('Hooks', () => {
9092 } ) . then ( ( res ) => {
9193 expect ( res ) . not . toBe ( null ) ;
9294 expect ( res ) . not . toBe ( undefined ) ;
95+ expect ( res . objectId ) . toBeUndefined ( ) ;
9396 expect ( res . url ) . toBe ( "http://someurl" ) ;
9497 // delete
9598 return Parse . Hooks . updateTrigger ( "MyClass" , "beforeDelete" , "http://anotherurl" ) ;
@@ -99,6 +102,7 @@ describe('Hooks', () => {
99102 } ) . then ( ( res ) => {
100103 expect ( res . className ) . toBe ( "MyClass" ) ;
101104 expect ( res . url ) . toBe ( "http://anotherurl" )
105+ expect ( res . objectId ) . toBeUndefined ( ) ;
102106
103107 return Parse . Hooks . deleteTrigger ( "MyClass" , "beforeDelete" ) ;
104108 } , ( err ) => {
Original file line number Diff line number Diff line change @@ -57,7 +57,12 @@ export class HooksController {
5757
5858 _getHooks ( query = { } , limit ) {
5959 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+ } ) ;
6166 }
6267
6368 _removeHooks ( query ) {
You can’t perform that action at this time.
0 commit comments