Commit 7efc0961 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

Merge remote-tracking branch 'origin/jaeyeon' into jiwon

parents 7953e3c1 aa87bd28
...@@ -6,7 +6,7 @@ const router = express.Router() ...@@ -6,7 +6,7 @@ const router = express.Router()
router.route('/login') router.route('/login')
.post(authCtrl.login) .post(authCtrl.login)
router.route('/logout') router.route('/logout')
.get(authCtrl.logout) .get(authCtrl.logout)
export default router export default router
\ No newline at end of file
...@@ -5,8 +5,11 @@ import productCtrl from '../controllers/product.controller.js'; ...@@ -5,8 +5,11 @@ import productCtrl from '../controllers/product.controller.js';
const router = express.Router() const router = express.Router()
router.route('/regist') router.route('/regist')
.post(productCtrl.fileUpload, productCtrl.regist) .post(productCtrl.imageUpload, productCtrl.regist)
router.route('/productone')
.get(productCtrl.getProduct) router.route('/getproduct/:category')
.get(productCtrl.getlist)
router.param('category', productCtrl.categoryId)
export default router export default router
\ No newline at end of file
import mongoose from 'mongoose' import mongoose from 'mongoose'
const { String} = mongoose.Schema.Types const { String, Number } = mongoose.Schema.Types
const ProductSchema = new mongoose.Schema({ const ProductSchema = new mongoose.Schema({
pro_name: { pro_name: {
...@@ -33,20 +33,19 @@ const ProductSchema = new mongoose.Schema({ ...@@ -33,20 +33,19 @@ const ProductSchema = new mongoose.Schema({
required: true, required: true,
}, },
sub_category: { sub_category: {
type: Array, type: [String],
required: true, required: true,
}, },
description: { description: {
type: String, type: String,
required: true, required: true,
}, },
main_image: { main_imgUrl: {
type: Array, type: String,
required: true, required: true
}, },
detail_image: { detail_imgUrls: {
type: Array, type: [String]
required: true,
} }
}, { }, {
timestamps: true timestamps: true
......
...@@ -16,7 +16,6 @@ const UserSchema = new mongoose.Schema({ ...@@ -16,7 +16,6 @@ const UserSchema = new mongoose.Schema({
type: String, type: String,
required: true, required: true,
}, },
number1: { number1: {
type: String, type: String,
required: true, required: true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment