Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
final-exam
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nawasan Wisitsingkhon
final-exam
Commits
44bf1622
Commit
44bf1622
authored
Oct 05, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search order by id
parent
735c3fd7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
order.js
src/pages/order.js
+3
-0
No files found.
src/pages/order.js
View file @
44bf1622
...
@@ -18,6 +18,7 @@ import PopupAlert from "@/components/PopupAlert";
...
@@ -18,6 +18,7 @@ import PopupAlert from "@/components/PopupAlert";
import
Head
from
"next/head"
;
import
Head
from
"next/head"
;
import
Link
from
"next/link"
;
import
Link
from
"next/link"
;
import
ConfirmPayment
from
"@/components/order/ConfirmPayment"
;
import
ConfirmPayment
from
"@/components/order/ConfirmPayment"
;
import
{
useRouter
}
from
"next/router"
;
export
default
function
Order
()
{
export
default
function
Order
()
{
const
user
=
useContext
(
UserContext
);
const
user
=
useContext
(
UserContext
);
...
@@ -27,6 +28,7 @@ export default function Order() {
...
@@ -27,6 +28,7 @@ export default function Order() {
const
order
=
useContext
(
OrderContext
);
const
order
=
useContext
(
OrderContext
);
const
[
payment
,
setPayment
]
=
useState
({
open
:
false
,
id
:
-
1
,
price
:
-
1
});
const
[
payment
,
setPayment
]
=
useState
({
open
:
false
,
id
:
-
1
,
price
:
-
1
});
const
[
payFilter
,
setPayFilter
]
=
useState
(
false
);
const
[
payFilter
,
setPayFilter
]
=
useState
(
false
);
const
router
=
useRouter
()
const
fetchProduct
=
async
()
=>
{
const
fetchProduct
=
async
()
=>
{
try
{
try
{
...
@@ -102,6 +104,7 @@ export default function Order() {
...
@@ -102,6 +104,7 @@ export default function Order() {
{
order
.
value
.
map
(
{
order
.
value
.
map
(
(
order
,
idx
)
=>
(
order
,
idx
)
=>
order
&&
order
&&
(
!
router
.
query
?.
q
||
Number
(
router
.
query
.
q
)
===
order
.
id
)
&&
(
!
payFilter
||
order
.
pay_status
===
0
)
&&
(
(
!
payFilter
||
order
.
pay_status
===
0
)
&&
(
<
TableRow
key
=
{
idx
}
>
<
TableRow
key
=
{
idx
}
>
<
TableCell
>
{
order
.
id
}
<
/TableCell
>
<
TableCell
>
{
order
.
id
}
<
/TableCell
>
...
...
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