Build a unified success JSON response. Returns ``(Response, status_code)`` for Flask. The envelope uses ``"status": "success"`` (not legacy ``"ok"``) and wraps the payload in the ``"data"`` key:: {"status": "success", "data": {...}} The response body must not include endp
(data: object = None, *, status_code: int = 200)
| 203 | # --------------------------------------------------------------------------- |
| 204 | |
| 205 | def json_ok(data: object = None, *, status_code: int = 200) -> tuple: |
| 206 | """Build a unified success JSON response. |
| 207 | |
| 208 | Returns ``(Response, status_code)`` for Flask. The envelope uses |
| 209 | ``"status": "success"`` (not legacy ``"ok"``) and wraps the payload |
| 210 | in the ``"data"`` key:: |
| 211 | |
| 212 | {"status": "success", "data": {...}} |
| 213 | |
| 214 | The response body must not include endpoint-specific top-level fields. |
| 215 | """ |
| 216 | return jsonify({"status": "success", "data": data}), status_code |
| 217 | |
| 218 | |
| 219 | def stream_preflight_error(error: AppError) -> tuple: |
no outgoing calls