Skip to content

Commit

Permalink
fix: data type handler
Browse files Browse the repository at this point in the history
Signed-off-by: Trey <[email protected]>
  • Loading branch information
TreyWW committed Oct 19, 2024
1 parent ba316f3 commit f78e012
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/core/api/public/helpers/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def APIResponse(success: bool = True, data: str | dict | None = None, meta=None,
status = 400

if success:
return Response({"meta": {"success": True, **meta}, "data": {**data, **kwargs}}, status=status)
return Response({"meta": {"success": True, **meta}, "data": {**kwargs} | data if isinstance(data, dict) else {}}, status=status)
else:
return Response({"meta": {"success": False}, "error": data}, status=status)

0 comments on commit f78e012

Please sign in to comment.