mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-22 14:38:11 +02:00
Allow users to upload photos using shared Cloudinary configuration
Update routes to use a shared Cloudinary configuration for media uploads and adjust CloudinaryService to fetch any available config instead of user-specific config. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/vZocxw2
This commit is contained in:
1 parent
f98da13491
commit
3175ffee31
2 files changed
+12
-11
No files matched your search
@@ -14,11 +14,11 @@ class CloudinaryService {
|
||||
instagramFeedUrl: string | null;
|
||||
instagramStoryUrl: string | null;
|
||||
}> {
|
||||
// Get user's Cloudinary config
|
||||
const config = await storage.getCloudinaryConfig(userId);
|
||||
// Get any available Cloudinary config (shared across all users)
|
||||
const config = await storage.getAnyCloudinaryConfig();
|
||||
|
||||
if (!config) {
|
||||
throw new Error('Cloudinary configuration not found. Please configure Cloudinary in Settings.');
|
||||
throw new Error('Cloudinary configuration not found. Please ask an administrator to configure Cloudinary in Settings first.');
|
||||
}
|
||||
|
||||
// Configure Cloudinary with user's credentials
|
||||
@@ -81,10 +81,11 @@ class CloudinaryService {
|
||||
}
|
||||
|
||||
async deleteMedia(publicId: string, userId: string, mediaType: 'image' | 'video'): Promise<void> {
|
||||
const config = await storage.getCloudinaryConfig(userId);
|
||||
// Get any available Cloudinary config (shared across all users)
|
||||
const config = await storage.getAnyCloudinaryConfig();
|
||||
|
||||
if (!config) {
|
||||
throw new Error('Cloudinary configuration not found');
|
||||
throw new Error('Cloudinary configuration not found. Please ask an administrator to configure Cloudinary in Settings first.');
|
||||
}
|
||||
|
||||
cloudinary.config({
|
||||
|
||||
Reference in new issue
Block a user