angular-sailsjs-boilerplate icon indicating copy to clipboard operation
angular-sailsjs-boilerplate copied to clipboard

DataModel handler verb 'Deleted' should be 'Destroyed'

Open markmssd opened this issue 9 years ago • 3 comments

By checking the log from DataModel after deleting an object, the console prints

'Implement handling for 'destroyed' socket messages'

I renamed that handler on line 164 for 'handlerDestroyed' instead of 'handlerDeleted', and it now works as expected!

DataModel.prototype.handlerDestroyed = function handlerDestroyed(message) {
    // method implementation here
}

markmssd avatar Dec 16 '15 07:12 markmssd

I'm testing with delete records in my webapp and find this same issue ('Implement handling for 'destroyed' socket messages'). is this an error? must I make this change in my code? Thanks

jjgonver avatar Aug 20 '16 16:08 jjgonver

I have made this change in line 164 of DataModel.js and work for me. Before this change, the record is deleted but don't work the socket.

jjgonver avatar Aug 20 '16 16:08 jjgonver

I just checked the corresponding docs: http://sailsjs.org/documentation/reference/blueprint-api/destroy

It clearly states that the event triggered is destroy. Cheers!

markmssd avatar Aug 21 '16 06:08 markmssd