Refactor user id merge in posts controller