attempt to create a function that user can publish a post in PostsController