list of products
This commit is contained in:
parent
52713221eb
commit
2b2e6682db
2 changed files with 0 additions and 5 deletions
|
@ -18,9 +18,6 @@ export async function createProduct(req: Request, res: Response) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List products: This should allow any user to view a paginated list of
|
|
||||||
// products, sorted by price.
|
|
||||||
|
|
||||||
export async function listProducts(req: Request, res: Response) {
|
export async function listProducts(req: Request, res: Response) {
|
||||||
try {
|
try {
|
||||||
const { page, limit } = req.query;
|
const { page, limit } = req.query;
|
||||||
|
|
|
@ -6,8 +6,6 @@ import { createProduct, listProducts } from '../controllers/ProductController';
|
||||||
|
|
||||||
const productRouter = express.Router();
|
const productRouter = express.Router();
|
||||||
|
|
||||||
// Create a product: This should require an authenticated user to provide a
|
|
||||||
// product name, description, and price.
|
|
||||||
productRouter.post('/', authenticateToken, createProduct)
|
productRouter.post('/', authenticateToken, createProduct)
|
||||||
productRouter.get('/', listProducts);
|
productRouter.get('/', listProducts);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue