Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
shopping-mall
Commits
0ed13690
Commit
0ed13690
authored
Jan 11, 2021
by
Jiwon Yoon
Browse files
0111 마지막
parent
c4db43eb
Changes
5
Show whitespace changes
Inline
Side-by-side
.gitignore
deleted
100644 → 0
View file @
c4db43eb
node_modules
\ No newline at end of file
client/src/Pages/Product.js
View file @
0ed13690
...
...
@@ -4,10 +4,23 @@ import { Row, Col, Form, Card, Button } from 'react-bootstrap';
import
catchErrors
from
'
../utils/catchErrors
'
;
function
Product
()
{
const
[
product
,
setProduct
]
=
useState
()
const
[
select
,
setSelect
]
=
useState
({
color
:
""
,
size
:
""
})
const
[
cart
,
setCart
]
=
useState
()
const
[
error
,
setError
]
=
useState
(
''
)
async
function
getProduct
(
user
){
console
.
log
(
user
)
try
{
const
response
=
await
axios
.
get
(
'
/api/product/productone
'
)
setProduct
(
response
.
data
)
console
.
log
(
response
.
data
)
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
}
}
function
handleClick
(
e
)
{
const
box
=
e
.
target
.
parentNode
.
parentNode
box
.
style
.
display
=
"
none
"
...
...
@@ -73,10 +86,12 @@ function Product() {
useEffect
(()
=>
{
handleCreate
()
getProduct
()
},
[
cart
])
return
(
<
div
>
{
/* {getProduct} */
}
<
style
type
=
"
text/css
"
>
{
`
.btn {
...
...
client/src/Pages/ProductsList.js
View file @
0ed13690
...
...
@@ -40,11 +40,11 @@ function ProductsList() {
`
}
<
/style
>
<
Container
>
<
Row
>
<
Col
sm
=
{
10
}
xs
=
{
12
}
>
<
Row
className
=
"
justify-content-center
"
>
<
Col
sm
=
{
10
}
xs
=
{
12
}
>
<
h1
style
=
{{
fontSize
:
"
3rem
"
}}
className
=
"
text-center
"
>
OUTER
<
/h1
>
<
div
>
{
sub
.
map
((
ele
)
=>
(
<
Button
className
=
"
justify-content-center
m-1
"
>
{
ele
}
<
/Button
>
<
div
className
=
"
text-center
"
>
{
sub
.
map
((
ele
)
=>
(
<
Button
className
=
"
m-1
"
>
{
ele
}
<
/Button
>
))}
<
/div
>
<
/Col
>
<
/Row
>
...
...
server/controllers/product.controller.js
View file @
0ed13690
...
...
@@ -28,4 +28,9 @@ const regist = async (req, res) => {
}
}
export
default
{
regist
,
fileUpload
}
\ No newline at end of file
const
getProduct
=
(
req
,
res
)
=>
{
res
.
json
(
req
.
body
)
}
export
default
{
regist
,
fileUpload
,
getProduct
}
\ No newline at end of file
server/routes/product.routes.js
View file @
0ed13690
...
...
@@ -10,5 +10,7 @@ const router = express.Router()
router
.
route
(
'
/regist
'
)
.
post
(
productCtrl
.
fileUpload
,
productCtrl
.
regist
)
router
.
route
(
'
/productone
'
)
.
get
(
productCtrl
.
getProduct
)
export
default
router
\ No newline at end of file
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