-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92db14d
commit b4f00ed
Showing
12 changed files
with
199 additions
and
50 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import { Router } from "express" | ||
import classPlanController from "../controllers/classPlanController" | ||
import AuthUser from "../middleware/authUser" | ||
|
||
const classPlanRouters = Router() | ||
const authenticateUser = new AuthUser() | ||
const classPlan = new classPlanController() | ||
|
||
classPlanRouters.post("/", classPlan.create) | ||
classPlanRouters.get("/:id", classPlan.show) | ||
classPlanRouters.post("/", authenticateUser.auth, classPlan.create) | ||
classPlanRouters.get("/:id", authenticateUser.auth, classPlan.show) | ||
classPlanRouters.get( | ||
"/pesquisa-data-titulo/:userId/:title/:startDate/:finalDate", | ||
authenticateUser.auth, | ||
classPlan.searchByCreatedAtOrTitle, | ||
) | ||
classPlanRouters.get("/planos-usuario/:userId", classPlan.list) | ||
classPlanRouters.put("/:id", classPlan.updateById) | ||
classPlanRouters.delete("/:id", classPlan.delete) | ||
classPlanRouters.put("/:id", authenticateUser.auth, classPlan.updateById) | ||
classPlanRouters.delete("/:id", authenticateUser.auth, classPlan.delete) | ||
|
||
export default classPlanRouters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
import { Router } from "express" | ||
import drillElementController from "@/controllers/drillElementController" | ||
import AuthUser from "../middleware/authUser" | ||
|
||
const drillElementRouters = Router() | ||
const authenticateUser = new AuthUser() | ||
const drillElement = new drillElementController() | ||
|
||
drillElementRouters.post("/", drillElement.create) | ||
drillElementRouters.get("/:drillId", drillElement.getManyByDrillId) | ||
drillElementRouters.put("/:id", drillElement.updateById) | ||
drillElementRouters.delete("/:id", drillElement.deleteById) | ||
drillElementRouters.post("/", authenticateUser.auth, drillElement.create) | ||
drillElementRouters.get( | ||
"/:drillId", | ||
authenticateUser.auth, | ||
drillElement.getManyByDrillId, | ||
) | ||
drillElementRouters.put("/:id", authenticateUser.auth, drillElement.updateById) | ||
drillElementRouters.delete( | ||
"/:id", | ||
authenticateUser.auth, | ||
drillElement.deleteById, | ||
) | ||
|
||
export default drillElementRouters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import { Router } from "express" | ||
import drillController from "../controllers/drillController" | ||
import AuthUser from "../middleware/authUser" | ||
|
||
const authenticateUser = new AuthUser() | ||
const drillRouters = Router() | ||
const drill = new drillController() | ||
|
||
drillRouters.post("/", drill.create) | ||
drillRouters.get("/:classPlanId", drill.getManyByClassPlanId) | ||
drillRouters.get("/drill/:id", drill.show) | ||
drillRouters.put("/:id", drill.updateById) | ||
drillRouters.put("/image/:id", drill.updateImage) | ||
drillRouters.delete("/:id", drill.deleteById) | ||
drillRouters.post("/", authenticateUser.auth, drill.create) | ||
drillRouters.get( | ||
"/:classPlanId", | ||
authenticateUser.auth, | ||
drill.getManyByClassPlanId, | ||
) | ||
drillRouters.get("/drill/:id", authenticateUser.auth, drill.show) | ||
drillRouters.put("/:id", authenticateUser.auth, drill.updateById) | ||
drillRouters.put("/image/:id", authenticateUser.auth, drill.updateImage) | ||
drillRouters.delete("/:id", authenticateUser.auth, drill.deleteById) | ||
|
||
export default drillRouters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.