// Fetch handles user's data retrieval.
Fetch handles user's data retrieval.
// Fetch handles user ' s data retrieval .
func (h *Handler) Fetch(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	_, id, err := httpflow.ExtractSession(ctx)
	if err != nil {
		httpflow.RespondError(h.log, w, r, err)
		return
	}
	usr, err := h.db.FetchUserByID(ctx, id)
	if err != nil {
		httpflow.RespondError(h.log, w, r, err)
		return
	}
	httpflow.Respond(h.log, w, r, usr, http.StatusOK)
}
func ( h * Handler ) Fetch ( w http . ResponseWriter , r * http . Request ) { ctx := r . Context ( ) _ , id , err := httpflow . ExtractSession ( ctx ) if err != nil { httpflow . RespondError ( h . log , w , r , err ) return } usr , err := h . db . FetchUserByID ( ctx , id ) if err != nil { httpflow . RespondError ( h . log , w , r , err ) return } httpflow . Respond ( h . log , w , r , usr , http . StatusOK ) }
Fetch handles user's data retrieval.
Fetch handles user ' s data retrieval .