// GetAllHandler response all the posts.
GetAllHandler response all the posts.
// GetAllHandler response all the posts .
func (pr *PostRouter) GetAllHandler(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	posts, err := pr.Repository.GetAll(ctx)
	if err != nil {
		response.HTTPError(w, r, http.StatusNotFound, err.Error())
		return
	}
	response.JSON(w, r, http.StatusOK, response.Map{"posts": posts})
}
func ( pr * PostRouter ) GetAllHandler ( w http . ResponseWriter , r * http . Request ) { ctx := r . Context ( ) posts , err := pr . Repository . GetAll ( ctx ) if err != nil { response . HTTPError ( w , r , http . StatusNotFound , err . Error ( ) ) return } response . JSON ( w , r , http . StatusOK , response . Map { " " : posts } ) }
GetAllHandler response all the posts.
GetAllHandler response all the posts .