Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ji-InPark committed May 16, 2024
2 parents fc7c458 + a455a56 commit 2498c61
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ class OrderService(
return savedOrder
}

private fun saveOrderProductAndSendWebsocketMessage(orderProduct: OrderProduct): OrderProduct {
val savedOrderProduct = orderProductRepository.save(orderProduct)
websocketService.sendMessage(
"/sub/order/${orderProduct.order.workspace.id}",
Message("CREATE", savedOrderProduct)
)
return savedOrderProduct
}

fun getAllOrdersByCondition(
username: String,
workspaceId: Long,
Expand Down Expand Up @@ -146,7 +155,7 @@ class OrderService(

val orderProduct = orderProductRepository.findById(orderProductId).orElseThrow()
orderProduct.isServed = isServed
return orderProductRepository.save(orderProduct)
return saveOrderProductAndSendWebsocketMessage(orderProduct)
}

fun changeOrderStatus(
Expand Down

0 comments on commit 2498c61

Please sign in to comment.