@@ -15,8 +15,11 @@ class ProductsController {
1515 this . router . get ( '/v1/products/:id' , security . checkUserScope . bind ( this , security . scope . READ_PRODUCTS ) , this . getSingleProduct . bind ( this ) ) ;
1616 this . router . put ( '/v1/products/:id' , security . checkUserScope . bind ( this , security . scope . WRITE_PRODUCTS ) , this . updateProduct . bind ( this ) ) ;
1717 this . router . delete ( '/v1/products/:id' , security . checkUserScope . bind ( this , security . scope . WRITE_PRODUCTS ) , this . deleteProduct . bind ( this ) ) ;
18+
19+ this . router . get ( '/v1/products/:id/images' , security . checkUserScope . bind ( this , security . scope . READ_PRODUCTS ) , this . getProductImages . bind ( this ) ) ;
1820 this . router . post ( '/v1/products/:id/images' , security . checkUserScope . bind ( this , security . scope . WRITE_PRODUCTS ) , this . addProductImage . bind ( this ) ) ;
1921 this . router . delete ( '/v1/products/:id/images/:image' , security . checkUserScope . bind ( this , security . scope . WRITE_PRODUCTS ) , this . deleteProductImage . bind ( this ) ) ;
22+
2023 this . router . get ( '/v1/products/:id/sku' , security . checkUserScope . bind ( this , security . scope . READ_PRODUCTS ) , this . isSkuExists . bind ( this ) ) ;
2124 this . router . get ( '/v1/products/:id/slug' , security . checkUserScope . bind ( this , security . scope . READ_PRODUCTS ) , this . isSlugExists . bind ( this ) ) ;
2225 }
@@ -61,6 +64,12 @@ class ProductsController {
6164 } ) . catch ( next ) ;
6265 }
6366
67+ getProductImages ( req , res , next ) {
68+ ProductsService . getProductImages ( req . params . id ) . then ( data => {
69+ res . send ( data )
70+ } ) . catch ( next ) ;
71+ }
72+
6473 addProductImage ( req , res , next ) {
6574 ProductsService . addProductImage ( req , res , next ) ;
6675 }
0 commit comments