Mercy Jemosop
09/19/2023, 2:29 PM@HiltWorker
class RegistrationRepositoryWorker @AssistedInject constructor(
@Assisted private val appContext: Context,
@Assisted private val workerParams: WorkerParameters,
private val mylApi: MyApi,
) :
CoroutineWorker(appContext, workerParams) {}
the code above fails with error Could not create Worker RegistrationRepositoryWorkerbut when I remove the MyApi from constructor it works well. How can I call the API correctly
interface MyApi{
@POST("register") // Replace with the actual API endpoint
suspend fun registerUser(@Body request: User): Response<ApiResponse>
}
Ahsan Ullah Rasel
09/20/2023, 12:20 AMMercy Jemosop
09/20/2023, 1:09 AM