861 B
861 B
API response helpers
The backend now exposes crate::http::responders, which wraps common success and
error patterns for routes:
ok_json,created_json,accepted_jsonreturnJsonResponse<T>with the respective status codes.no_content/emptyprovide shared empty responses.JsonResponse<T>implementsIntoResponse, so any handler can returnAppResult<JsonResponse<T>>without pairing tuples manually.IntoAppResult,RowsAffectedExt, and friends convert Diesel results intoAppResult<T>with consistentAppErrorhandling.
When adding new routes, import from crate::http::responders instead of
constructing (StatusCode, Json<T>) tuples directly. The folders, documents,
auth, capability-set, correspondent, tag, and profile routers now all share
these helpers; WebDAV keeps its bespoke streaming responses for now.