TomDoesTech / REST-API-Tutorial-Updated

https://www.youtube.com/watch?v=BWUi6BS9T5Y
574 stars 283 forks source link

typo on delete product route? #4

Closed Aron-HD closed 2 years ago

Aron-HD commented 3 years ago

I believe there is a typo in the product delete route, where get handler is used instead of delete handler.

import {
  createProductHandler,
  <---------------------------------- deleteProductHandler,
  getProductHandler,
  updateProductHandler
} from './controller/product.controller';

   ...

  app.delete(
    '/api/products/:productId',
    [requireUser, validateResource(deleteProductSchema)],
    getProductHandler <---------------------------------------- deleteProductHandler
  );

(Awesome tutorial btw, enjoyed building it and am moving onto testing next!)

tomanagle commented 2 years ago

Yup, looks like a typo. Do you want to submit a PR to fix it?

Aron-HD commented 2 years ago

sure - submitted :)