Skip to content

Commit

Permalink
Update supplierController.js
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jul 25, 2023
1 parent a9872d0 commit 8d7682a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions api/routes/companyRoutes.js

This file was deleted.

15 changes: 15 additions & 0 deletions api/routes/supplierRoutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import express from 'express'
import routeNames from '../config/supplierRoutes.config.js'
import authJwt from '../middlewares/authJwt.js'
import * as supplierController from '../controllers/supplierController.js'

const routes = express.Router()

routes.route(routeNames.validate).post(authJwt.verifyToken, supplierController.validate)
routes.route(routeNames.update).put(authJwt.verifyToken, supplierController.update)
routes.route(routeNames.delete).delete(authJwt.verifyToken, supplierController.deleteCompany)
routes.route(routeNames.getCompany).get(authJwt.verifyToken, supplierController.getCompany)
routes.route(routeNames.getCompanies).get(authJwt.verifyToken, supplierController.getCompanies)
routes.route(routeNames.getAllCompanies).get(supplierController.getAllCompanies)

export default routes
4 changes: 2 additions & 2 deletions api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import strings from './config/app.config.js'
import userRoutes from './routes/userRoutes.js'
import carRoutes from './routes/carRoutes.js'
import notificationRoutes from './routes/notificationRoutes.js'
import companyRoutes from './routes/companyRoutes.js'
import supplierRoutes from './routes/supplierRoutes.js'
import locationRoutes from './routes/locationRoutes.js'
import bookingRoutes from './routes/bookingRoutes.js'

Expand Down Expand Up @@ -66,7 +66,7 @@ app.use(express.urlencoded({ limit: '50mb', extended: true }))
app.use(express.json({ limit: '50mb' }))
app.use(cors())
app.use('/', userRoutes)
app.use('/', companyRoutes)
app.use('/', supplierRoutes)
app.use('/', locationRoutes)
app.use('/', carRoutes)
app.use('/', bookingRoutes)
Expand Down

0 comments on commit 8d7682a

Please sign in to comment.