This repository has been archived on 2026-05-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
PolyNotFound/routes/ad.routes.js
2021-12-22 11:09:20 +01:00

24 lines
659 B
JavaScript

const ads = require("../controllers/ad.controller");
module.exports = app => {
let router = require("express").Router();
// Create a new Ad
router.post("/ad/create", ads.create);
// Retrieve all Ad from id if admin or session id
router.get("/ad/findAll", ads.findAll);
// Find single Ad from id if admin or session id
router.get("/ad/findOne/:id", ads.findOne);
// Update a Ad with ad id
router.put("/ad/update/:id", ads.update);
// Delete a Ad with ad id
router.delete("/ad/delete/:id", ads.delete);
// Delete all Ad from id if admin or session id
router.delete("/ad/deleteAll", ads.deleteAll);
app.use('/api', router);
};