feat(contribute): upload event images to OneDrive before submission
- ApiClient.uploadFile() — multipart POST to /v1/upload/file (60s timeout)
- ApiEndpoints.uploadFile — points to Node.js upload endpoint
- GamificationService.submitContribution() now uploads each picked image
to OneDrive via the server upload pipeline, then passes the returned
{ fileId, url, ... } objects as `media` in the submission body
(replaces broken behaviour of sending local device paths as strings)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,18 @@ class AuthService {
|
||||
// Save phone if provided (optional)
|
||||
if (res['phone_number'] != null) await prefs.setString('phone_number', res['phone_number'].toString());
|
||||
|
||||
// Save profile photo from login response
|
||||
final rawPhoto = res['profile_photo']?.toString() ?? '';
|
||||
if (rawPhoto.isNotEmpty) {
|
||||
final photoUrl = rawPhoto.startsWith('http') ? rawPhoto : 'https://em.eventifyplus.com$rawPhoto';
|
||||
await prefs.setString('profileImage_$savedEmail', photoUrl);
|
||||
await prefs.setString('profileImage', photoUrl);
|
||||
}
|
||||
|
||||
// Save Eventify ID
|
||||
final eventifyId = res['eventify_id']?.toString() ?? '';
|
||||
if (eventifyId.isNotEmpty) await prefs.setString('eventify_id', eventifyId);
|
||||
|
||||
PostHogService.instance.identify(savedEmail, properties: {
|
||||
'username': displayCandidate,
|
||||
'login_method': 'email',
|
||||
@@ -178,6 +190,18 @@ class AuthService {
|
||||
}
|
||||
if (res['phone_number'] != null) await prefs.setString('phone_number', res['phone_number'].toString());
|
||||
|
||||
// Save profile photo from Google login response
|
||||
final rawPhoto = res['profile_photo']?.toString() ?? '';
|
||||
if (rawPhoto.isNotEmpty) {
|
||||
final photoUrl = rawPhoto.startsWith('http') ? rawPhoto : 'https://em.eventifyplus.com$rawPhoto';
|
||||
await prefs.setString('profileImage_$serverEmail', photoUrl);
|
||||
await prefs.setString('profileImage', photoUrl);
|
||||
}
|
||||
|
||||
// Save Eventify ID
|
||||
final eventifyId = res['eventify_id']?.toString() ?? '';
|
||||
if (eventifyId.isNotEmpty) await prefs.setString('eventify_id', eventifyId);
|
||||
|
||||
PostHogService.instance.identify(serverEmail, properties: {
|
||||
'username': displayName,
|
||||
'login_method': 'google',
|
||||
|
||||
Reference in New Issue
Block a user