ssl
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions

This commit is contained in:
Dmitry 2025-12-19 05:13:43 +03:00
parent 9482b52946
commit a882b9c7e6

View file

@ -24,8 +24,9 @@ class MediaApiV2 {
Router get router => _$MediaApiV2Router(this);
Response _ok(Object? object, {Map<String, String> headers = const {}}) =>
Response.ok(
object == null ? null : jsonEncode(object),
Response(
200,
body: object == null ? null : jsonEncode(object),
headers: {
'Content-Type': 'application/json',
...headers,
@ -166,10 +167,15 @@ class MediaApiV2 {
objectId: objectId,
);
return _ok({
final responseData = {
'objectId': objectId,
'url': presignedUrl,
});
};
print('✅ Upload successful, returning response: $responseData');
final response = _ok(responseData);
print('✅ Response created with status: ${response.statusCode}, headers: ${response.headers}');
return response;
} catch (e, s) {
print('Error uploading card image: $e\n$s');
return _internalServerError('Failed to upload image');