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
410cd60f
Commit
410cd60f
authored
Jan 27, 2021
by
Jiwon Yoon
Browse files
디테일이미지 여러개
parent
fbce3d1a
Changes
2
Show whitespace changes
Inline
Side-by-side
client/src/Pages/ProductRegist.js
View file @
410cd60f
...
...
@@ -109,9 +109,9 @@ function ProductsRegist() {
console
.
log
(
product
)
const
formData
=
new
FormData
();
for
(
let
key
in
product
)
{
if
(
key
===
"
main_image
"
||
key
===
"
detail_image
"
)
{
if
(
key
===
"
main_image
"
)
{
formData
.
append
(
key
,
product
[
key
][
0
])
}
else
if
(
key
===
"
sizes
"
||
key
===
"
colors
"
||
key
===
"
sub_category
"
)
{
}
else
if
(
key
===
"
sizes
"
||
key
===
"
colors
"
||
key
===
"
sub_category
"
||
key
===
"
detail_image
"
)
{
for
(
let
i
=
0
;
i
<
product
[
key
].
length
;
i
++
)
{
formData
.
append
([
key
],
product
[
key
][
i
])
}
...
...
@@ -244,7 +244,7 @@ function ProductsRegist() {
<
/Form.Group
>
<
Form
.
Group
>
<
Form
.
Label
>
상세이미지
<
/Form.Label
>
<
Form
.
File
id
=
"
productImageform
"
name
=
"
detail_image
"
onChange
=
{
handleChange
}
/
>
<
Form
.
File
id
=
"
productImageform
"
name
=
"
detail_image
"
onChange
=
{
handleChange
}
multiple
/>
<
/Form.Group
>
<
Button
type
=
"
submit
"
style
=
{{
background
:
'
#91877F
'
,
borderColor
:
'
#91877F
'
}}
block
>
{
loading
&&
<
Spinner
as
=
'
span
'
animation
=
'
border
'
size
=
'
sm
'
role
=
'
status
'
aria
-
hidden
=
'
true
'
/>
}{
'
'
}
등록
...
...
server/controllers/product.controller.js
View file @
410cd60f
...
...
@@ -5,7 +5,7 @@ const upload = multer({ dest: 'uploads/' })
const
imageUpload
=
upload
.
fields
([
{
name
:
'
main_image
'
},
{
name
:
'
detail_image
'
}
{
name
:
'
detail_image
'
}
])
const
regist
=
async
(
req
,
res
)
=>
{
...
...
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