Clarification in delete-user.js
#137
-
Hi @neonexus In await sails.models.user.update({id: foundUser.id}).set(_.merge({}, foundUser, {
deletedAt: moment.tz(sails.config.datastores.default.timezone).toDate(),
deletedBy: env.req.session.user.id
})); Why are you merging the existing user data with |
Beta Was this translation helpful? Give feedback.
Answered by
neonexus
Sep 15, 2024
Replies: 1 comment 1 reply
-
@MaheshkumarSundaram sorry for delay; haven't been keeping up with open-source stuff as of late. Frankly, looking at this, the merge is not needed; I don't know why this is here. However, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MaheshkumarSundaram
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@MaheshkumarSundaram sorry for delay; haven't been keeping up with open-source stuff as of late.
Frankly, looking at this, the merge is not needed; I don't know why this is here. However,
deletedAt
anddeletedBy
are special "soft-delete" attributes.updatedAt
has no bearing here; it will always update on a record update.