diff options
Diffstat (limited to 'components/bidding/bidding-round-actions.tsx')
| -rw-r--r-- | components/bidding/bidding-round-actions.tsx | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/components/bidding/bidding-round-actions.tsx b/components/bidding/bidding-round-actions.tsx index b2db0dfb..86fea72a 100644 --- a/components/bidding/bidding-round-actions.tsx +++ b/components/bidding/bidding-round-actions.tsx @@ -35,16 +35,27 @@ export function BiddingRoundActions({ biddingId, biddingStatus }: BiddingRoundAc const { data: session } = useSession()
const userId = session?.user?.id
- // 차수증가는 유찰 상태에서만 가능
- const canIncreaseRound = biddingStatus === 'bidding_disposal'
-
- // 재입찰도 유찰 상태에서만 가능
+ // 차수증가는 입찰공고 또는 입찰 진행중 상태에서 가능
+ const canIncreaseRound = biddingStatus === 'bidding_generated' || biddingStatus === 'bidding_opened'
+
+ // 유찰 및 낙찰은 입찰 진행중 상태에서 가능 (이 컴포넌트에서는 사용하지 않음)
+
+ // 재입찰은 유찰 상태에서만 가능
const canRebid = biddingStatus === 'bidding_disposal'
const handleRoundIncrease = () => {
+ if (!userId) {
+ toast({
+ title: "오류",
+ description: "사용자 정보를 찾을 수 없습니다.",
+ variant: "destructive",
+ })
+ return
+ }
+ const userIdStr = userId as string
startTransition(async () => {
try {
- const result = await increaseRoundOrRebid(biddingId, userId, 'round_increase')
+ const result = await increaseRoundOrRebid(biddingId, userIdStr, 'round_increase')
if (result.success) {
toast({
@@ -77,9 +88,18 @@ export function BiddingRoundActions({ biddingId, biddingStatus }: BiddingRoundAc }
const handleRebid = () => {
+ if (!userId) {
+ toast({
+ title: "오류",
+ description: "사용자 정보를 찾을 수 없습니다.",
+ variant: "destructive",
+ })
+ return
+ }
+ const userIdStr = userId as string
startTransition(async () => {
try {
- const result = await increaseRoundOrRebid(biddingId, userId, 'rebidding')
+ const result = await increaseRoundOrRebid(biddingId, userIdStr, 'rebidding')
if (result.success) {
toast({
|
