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
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:
parent
9482b52946
commit
a882b9c7e6
1 changed files with 10 additions and 4 deletions
|
|
@ -24,8 +24,9 @@ class MediaApiV2 {
|
||||||
Router get router => _$MediaApiV2Router(this);
|
Router get router => _$MediaApiV2Router(this);
|
||||||
|
|
||||||
Response _ok(Object? object, {Map<String, String> headers = const {}}) =>
|
Response _ok(Object? object, {Map<String, String> headers = const {}}) =>
|
||||||
Response.ok(
|
Response(
|
||||||
object == null ? null : jsonEncode(object),
|
200,
|
||||||
|
body: object == null ? null : jsonEncode(object),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
...headers,
|
...headers,
|
||||||
|
|
@ -166,10 +167,15 @@ class MediaApiV2 {
|
||||||
objectId: objectId,
|
objectId: objectId,
|
||||||
);
|
);
|
||||||
|
|
||||||
return _ok({
|
final responseData = {
|
||||||
'objectId': objectId,
|
'objectId': objectId,
|
||||||
'url': presignedUrl,
|
'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) {
|
} catch (e, s) {
|
||||||
print('Error uploading card image: $e\n$s');
|
print('Error uploading card image: $e\n$s');
|
||||||
return _internalServerError('Failed to upload image');
|
return _internalServerError('Failed to upload image');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue