Implemented the edit action for posts