Closed clbn closed 8 years ago
I'd suggest using hdel
instead of hset
to an empty value.
@epicmonkey Thank you, it makes sense.
On the other hand, when we create an attachment, it has postId === ''
, so hset
with an empty string just restores it to the "original" unattached state.
Doh! :-)
So should I change it or leave as it is now? Gimme my +1!
@berkus Parameter name has been fixed.
@berkus @indeyets @epicmonkey Ping.
other than Post.prototype.unlinkAttachments introduces a new promise (vs es6 await) LGTM.
@epicmonkey Basically just copied it from linkAttachments()
. Didn't want to add refactoring to this change, just to be on the safe side.
@epicmonkey @indeyets @berkus
Please take a look at the implementation of
unlinkAttachments()
in the change. I need a confirmation that this piece of code does a proper DB change:(as an opposite to what we do in its sister method,
linkAttachments()
).