package com.socialapp.domain.usecase import com.socialapp.data.api.ApiService import com.socialapp.domain.model.AppConfig import javax.inject.Inject class GetAppConfigUseCase @Inject constructor( private val apiService: ApiService ) { suspend operator fun invoke(): Result = try { val response = apiService.getAppConfig() if (response.isSuccessful && response.body() != null) { Result.success(response.body()!!) } else { Result.failure(Exception("Failed to fetch config")) } } catch (e: Exception) { Result.failure(e) } }