@@ -96,11 +96,11 @@ router.post('/exhibitions', verifyToken, upload.array('exhibition_image', 1), as
9696
9797
9898
99+ //전시 상세 조회 API
99100//전시 상세 조회 API
100101router . get ( '/exhibitions/:exhibition_id' , async ( req , res ) => {
101102 try {
102103 const { exhibition_id } = req . params ;
103- const user_id = req . user . id ;
104104
105105 const exhibition = await Exhibition . findOne ( {
106106 attributes : [ 'id' , 'title' , 'image_url' , 'author_id' ] ,
@@ -120,11 +120,6 @@ router.get('/exhibitions/:exhibition_id', async (req, res) => {
120120 return sendResponse ( res , status . AUTHOR_NOT_FOUND ) ;
121121 }
122122
123- // 사용자가 해당 전시를 마이컬렉션에 추가했는지 확인
124- const isFavorite = await FavoriteExhibition . findOne ( {
125- where : { user_id, exhibition_id } ,
126- } ) ;
127-
128123 const authorExhibitions = await Exhibition . findAll ( {
129124 attributes : [ 'id' , 'title' , 'image_url' ] ,
130125 where : {
@@ -147,7 +142,6 @@ router.get('/exhibitions/:exhibition_id', async (req, res) => {
147142 exhibition_id : exhibition . id ,
148143 title : exhibition . title ,
149144 image_url : exhibition . image_url ,
150- is_favorite : ! ! isFavorite , // 마이컬렉션 추가 여부
151145 } ,
152146 author : {
153147 author_id : exhibition . author_id ,
@@ -171,6 +165,7 @@ router.get('/exhibitions/:exhibition_id', async (req, res) => {
171165 }
172166} ) ;
173167
168+
174169// 마이컬렉션 추가 API
175170router . post ( '/exhibitions/:exhibition_id/favorite' , verifyToken , async ( req , res ) => {
176171 try {
0 commit comments