Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
order-management-react
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
order-management-react
Commits
6261f87b
Commit
6261f87b
authored
May 05, 2021
by
Shanelle Valencia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-24]
🚧
Fix search issues with order type [@valencia]
parent
99c953ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
22 deletions
+7
-22
SearchOrder.tsx
src/components/SearchOrder.tsx
+7
-22
No files found.
src/components/SearchOrder.tsx
View file @
6261f87b
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Link
}
from
'react-router-dom'
<<
<
<<<<
HEAD
import
{
Order
}
from
'Order'
;
=======
>
>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
const
SearchOrder
=
(
props
:
any
)
=>
{
const
orders
=
props
.
orders
;
...
...
@@ -12,10 +11,9 @@ const SearchOrder = (props: any) => {
const
[
searchResult
,
setSearchResult
]
=
useState
([]);
console
.
log
(
"ORDERS"
,
orders
)
<<
<
<<<<
HEAD
// console.log("props", props)
=======
>
>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
const
handleSearchInput
=
(
event
:
any
)
=>
{
setSearchInput
(
event
.
target
.
value
);
...
...
@@ -26,16 +24,11 @@ const SearchOrder = (props: any) => {
}
useEffect
(()
=>
{
<
<<<<<<
HEAD
if
(
orders
.
length
>
0
)
{
const
res
=
orders
.
filter
((
order
:
Order
)
=>
order
.
orderNumber
.
includes
(
searchInput
)
//|| order.date.includes(searchInput)
=======
if
(
orders
.
length
>
0
)
{
const
res
=
orders
.
filter
((
order
:
any
)
=>
order
.
orderNumber
.
includes
(
searchInput
)
||
order
.
date
.
includes
(
searchInput
)
order
.
orderNumber
.
includes
(
searchInput
)
//
|| order.date.includes(searchInput)
// console.log(orderNum)
>>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
);
// debugger
setSearchResult
(
res
);
...
...
@@ -53,21 +46,13 @@ const SearchOrder = (props: any) => {
onChange=
{
handleSearchInput
}
/>
<
ul
>
<
<<<<<<
HEAD
{
searchResult
.
map
((
item
:
any
,
idx
)
=>
{
// debugger
return
(
<
li
key=
{
idx
}
>
<
Link
to=
{
"/orders/"
+
item
.
orderNumber
}
>
{
item
.
orderNumber
}
</
Link
>
</
li
>
=======
{
searchResult
.
map
((
item
,
idx
)
=>
{
// debugger
return
(
<
tr
key=
{
idx
}
>
<
Link
to=
{
"/orders/"
+
item
}
>
item
</
Link
>
</
tr
>
>>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
)
})
}
</
ul
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment