diff --git a/backend/src/services/branding.service.ts b/backend/src/services/branding.service.ts index 2760638..8f36d57 100644 --- a/backend/src/services/branding.service.ts +++ b/backend/src/services/branding.service.ts @@ -4,8 +4,6 @@ */ import { randomUUID } from 'crypto'; -import { promises as fs } from 'fs'; -import path from 'path'; export interface BrandingConfig { id: string; @@ -27,22 +25,11 @@ export interface BrandingConfig { class BrandingService { private configs: Map = new Map(); - private storagePath: string; constructor() { - this.storagePath = path.join(process.cwd(), 'storage', 'branding'); - this.ensureStorageDirectory(); this.loadDefaultBranding(); } - private async ensureStorageDirectory() { - try { - await fs.mkdir(this.storagePath, { recursive: true }); - } catch (error) { - console.warn('Could not create branding storage directory:', error); - } - } - private loadDefaultBranding() { // Create a default branding configuration const defaultBranding: BrandingConfig = { @@ -91,9 +78,6 @@ class BrandingService { this.configs.set(id, branding); - // Persist to disk - await this.persistBranding(id, branding); - return branding; } @@ -112,31 +96,7 @@ class BrandingService { throw new Error('Cannot delete default branding'); } - const deleted = this.configs.delete(id); - - if (deleted) { - // Remove from disk - try { - const filePath = path.join(this.storagePath, `${id}.json`); - await fs.unlink(filePath); - } catch (error) { - console.warn(`Could not delete branding file for ${id}:`, error); - } - } - - return deleted; - } - - /** - * Persist branding configuration to disk - */ - private async persistBranding(id: string, branding: BrandingConfig) { - try { - const filePath = path.join(this.storagePath, `${id}.json`); - await fs.writeFile(filePath, JSON.stringify(branding, null, 2)); - } catch (error) { - console.error(`Failed to persist branding ${id}:`, error); - } + return this.configs.delete(id); } }