changed method to accept a post object instead of ID