musicdlp/backend/response.py

23 lines
390 B
Python
Raw Normal View History

2024-05-02 16:18:27 +03:00
import json
OK = '{"ok":true}'
def ok_init(key: str) -> str:
return json.dumps({
"ok": True,
"data": key,
})
def ok_playlist(items: list[str]) -> str:
return json.dumps({
"ok": True,
"data": items,
})
def error_field(field: str) -> str:
return json.dumps({
"ok": False,
"error": "field",
"data": field,
})