Skip to content

Commit 47e64eb

Browse files
author
Muhammed Refaat
committed
Product Done!
1 parent 7a4f502 commit 47e64eb

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.example.data.features.product.dataSourceContract
22

33
import com.example.domain.common.ResultWrapper
4-
import com.example.domain.features.product.model.Product
4+
import com.example.domain.features.products.model.Product
55
import kotlinx.coroutines.flow.Flow
66

77
interface ProductDataSource {
8-
suspend fun getProducts(categoryId: String? = null): Flow<ResultWrapper<List<Product>>>
8+
suspend fun getProducts() : Flow<ResultWrapper<List<Product?>?>>
99
}

data/src/main/java/com/example/data/features/product/datasourceImpl/ProductDataSourceImpl.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ package com.example.data.features.product.dataSourceImpl
22

33
import com.example.data.api.WebServices
44
import com.example.data.features.product.dataSourceContract.ProductDataSource
5+
import com.example.data.model.BaseResponse
56
import com.example.data.safeAPiCall
67
import com.example.domain.common.ResultWrapper
7-
import com.example.domain.features.product.model.Product
8+
import com.example.domain.features.products.model.Product
89
import kotlinx.coroutines.flow.Flow
910
import javax.inject.Inject
1011

1112
class ProductDataSourceImpl @Inject constructor(
12-
private val webServices: WebServices
13+
private val webServices: WebServices
1314
) : ProductDataSource {
14-
override suspend fun getProducts(categoryId: String?): Flow<ResultWrapper<List<Product>>> {
15-
return safeAPiCall { webServices.getProductsList(categoryId) }
15+
override suspend fun getProducts(): Flow<ResultWrapper<List<Product?>?>> {
16+
return safeAPiCall { webServices.getProducts() }
1617
}
1718

1819
}

0 commit comments

Comments
 (0)