| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- const { User } = require('../models/user.model');
- const express = require('express');
- const router = express.Router();
- const authorize = require('../middleware/authorize');
- const Role = require('../lib/role')
- const UserController = require('../controllers/user');
- const GainController = require('../controllers/gain');
- const { LimitRequests } = require ('../middleware/limit-requests')
- //get all users
- router.get("/", authorize([Role.Employee,Role.Admin]), UserController.getAllUsers);
- //get user by id
- //router.get('/:id', UserController.getUserById);
- router.get('/:id', authorize([Role.Client,Role.Employee,Role.Admin]), UserController.getUserById);
- //delete user by id
- router.delete('/:id', authorize([Role.Employee,Role.Admin]) ,UserController.deleteUserById);
- //patch by id
- //router.patch('/:id', UserController.patchUserById)
- router.patch('/:id', authorize([Role.Client,Role.Employee,Role.Admin]), UserController.patchUserById)
- //post code gain
- router.post('/gain', authorize(Role.Client), GainController.gain);
- //router.post('/gain', GainController.gain);
- module.exports = router;
- // <div class="container navtop">
- // <h2 class="text-center titre font-weight-bold"><b> Tour du véhicule</b></h2>
- // <div class=" row justify-content-center mt-3 ">
- // <div class="col-10 col-md-6">
- // <img [src]="img" class="img-fluid" alt="clem">
- // </div>
- // </div>
- // <div class=" row justify-content-center mt-3 ">
- // <h3 class="col-7 col-md-4 text-center txt font-weight-bold" style="color: red;">
- // Veuillez sélectionner les éléments accidentés :</h3>
- // </div>
- // <!-- zone 1 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 1</b></h3>
- // <li *ngFor="let item of zone1">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 2 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 2</b></h3>
- // <li *ngFor="let item of zone2">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 3 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 3</b></h3>
- // <li *ngFor="let item of zone3">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 4 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 4</b></h3>
- // <li *ngFor="let item of zone4">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 5 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 5</b></h3>
- // <li *ngFor="let item of zone5">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 6 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 6</b></h3>
- // <li *ngFor="let item of zone6">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 7 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 7</b></h3>
- // <li *ngFor="let item of zone7">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <!-- zone 8 -->
- // <ul>
- // <h3 class="titre font-weight-bold zone"><b>ZONE 8</b></h3>
- // <li *ngFor="let item of zone8">
- // <mat-checkbox [(ngModel)]="item.checked">
- // {{item.name}}
- // </mat-checkbox>
- // </li>
- // </ul>
- // <div class=" row justify-content-center mt-3 mb-5">
- // <button class="col-8 col-md-4" mat-raised-button color="primary" (click)="sendCheck()">
- // <b> Valider</b></button>
- // </div>
- // </div>
|