initial codex commit
Some checks failed
Release / build (push) Failing after 48s
Release / release-dev (push) Has been skipped
Release / release-master (push) Has been skipped
Release / windows-build (push) Has been cancelled

This commit is contained in:
2025-12-11 01:08:30 +00:00
parent e6d7e71a36
commit 40ee16d2d5
20 changed files with 2902 additions and 283 deletions

View File

@@ -35,10 +35,11 @@ class ApiService {
dynamic data, {
Map<String, String>? headers,
}) async {
final hasBody = data != null;
final response = await http.post(
Uri.parse('$baseUrl$endpoint'),
headers: _buildHeaders(_jsonHeaders(headers)),
body: jsonEncode(data),
headers: _buildHeaders(hasBody ? _jsonHeaders(headers) : headers),
body: hasBody ? jsonEncode(data) : null,
);
return _processResponse(response);
}
@@ -60,10 +61,11 @@ class ApiService {
dynamic data, {
Map<String, String>? headers,
}) async {
final hasBody = data != null;
final response = await http.put(
Uri.parse('$baseUrl$endpoint'),
headers: _buildHeaders(_jsonHeaders(headers)),
body: jsonEncode(data),
headers: _buildHeaders(hasBody ? _jsonHeaders(headers) : headers),
body: hasBody ? jsonEncode(data) : null,
);
return _processResponse(response);
}