Skip to content

Commit

Permalink
feat: junior cannt reorder order & add to sl
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton authored and kris-liu-smile committed Mar 10, 2023
1 parent 14fcc0e commit b504656
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export const OrderAction = (props: OrderActionProps) => {
key: 'Re-Order',
name: 'reOrder',
variant: 'outlined',
isCanShow: true,
isCanShow: +role !== 2,
},
{
value: 'Return',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const OrderShoppingList = (props: orderShoppingListProps) => {
state: {
isB2BUser,
currentChannelId,
role,
},
} = useContext(GlobaledContext)

Expand All @@ -100,9 +101,16 @@ export const OrderShoppingList = (props: orderShoppingListProps) => {
},
}: CustomFieldItems = await getShoppingList(params)

const newList = list.filter((item: CustomFieldItems) => (isB2BUser ? item.node.status === 0 : true))
let newList = null
if (+role === 2) {
newList = list.filter((item: CustomFieldItems) => (item.node.status === 30))

setList(newList)
setList(newList)
} else {
newList = list.filter((item: CustomFieldItems) => (isB2BUser ? item.node.status === 0 : true))

setList(newList)
}
} finally {
setLoading(false)
}
Expand Down

0 comments on commit b504656

Please sign in to comment.