Skip to content

Commit

Permalink
Update status parameter to use WCOrderStatusModel instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
hafizrahman committed Dec 16, 2024
1 parent f9bad88 commit 3ba4738
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,11 @@ class WCOrderStoreTest {
.thenReturn(BulkUpdateOrderStatusResponsePayload(successResponses))

// When
val result = orderStore.batchUpdateOrdersStatus(site, orderIds, newStatus)
val result = orderStore.batchUpdateOrdersStatus(
site,
orderIds,
WCOrderStatusModel(COMPLETED.value)
)

// Then
assertThat(result.isError).isFalse()
Expand Down Expand Up @@ -687,7 +691,11 @@ class WCOrderStoreTest {
.thenReturn(BulkUpdateOrderStatusResponsePayload(mixedResponses))

// When
val result = orderStore.batchUpdateOrdersStatus(site, orderIds, newStatus)
val result = orderStore.batchUpdateOrdersStatus(
site,
orderIds,
WCOrderStatusModel(COMPLETED.value)
)

// Then
assertThat(result.isError).isFalse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,9 +1174,9 @@ class WCOrderStore @Inject constructor(
suspend fun batchUpdateOrdersStatus(
site: SiteModel,
orderIds: List<Long>,
newStatus: String
newStatus: WCOrderStatusModel
): WooResult<UpdateOrdersStatusResult> {
val result = wcOrderRestClient.batchUpdateOrdersStatus(site, orderIds, newStatus)
val result = wcOrderRestClient.batchUpdateOrdersStatus(site, orderIds, newStatus.statusKey)

return if (!result.isError) {
val orders = result.response
Expand Down

0 comments on commit 3ba4738

Please sign in to comment.