Lint errors
Signed-off-by: Rodrigo Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
f9d4f381f0
commit
ea0481e09e
1 file changed
+8
-8
@@ -1,4 +1,4 @@
|
||||
import { Router } from "express";
|
||||
import { Router, Request, Response } from "express";
|
||||
import multer from "multer";
|
||||
import { startOfWeek, endOfWeek, parseISO } from 'date-fns';
|
||||
import { ptBR } from 'date-fns/locale';
|
||||
@@ -39,7 +39,7 @@ function isValidUUID(uuid: string): boolean {
|
||||
}
|
||||
|
||||
// Rota para listar agendamentos
|
||||
router.get("/agendamentos", async (req, res) => {
|
||||
router.get("/agendamentos", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { data } = req.query;
|
||||
console.log("Requisição de agendamentos recebida, data:", data);
|
||||
@@ -126,7 +126,7 @@ router.get("/agendamentos", async (req, res) => {
|
||||
});
|
||||
|
||||
// Rota para criar um novo agendamento
|
||||
router.post("/agendamentos", async (req, res) => {
|
||||
router.post("/agendamentos", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { clienteId, data, observacoes, tipo } = req.body;
|
||||
console.log("Criando agendamento:", { clienteId, data, observacoes, tipo });
|
||||
@@ -178,7 +178,7 @@ router.post("/agendamentos", async (req, res) => {
|
||||
});
|
||||
|
||||
// Rota para atualizar um agendamento
|
||||
router.put("/agendamentos/:id", async (req, res) => {
|
||||
router.put("/agendamentos/:id", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { clienteId, data, observacoes, tipo } = req.body;
|
||||
@@ -236,7 +236,7 @@ router.put("/agendamentos/:id", async (req, res) => {
|
||||
});
|
||||
|
||||
// Rota para excluir um agendamento
|
||||
router.delete("/agendamentos/:id", async (req, res) => {
|
||||
router.delete("/agendamentos/:id", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
console.log("Excluindo agendamento:", id);
|
||||
@@ -281,7 +281,7 @@ router.delete("/agendamentos/:id", async (req, res) => {
|
||||
});
|
||||
|
||||
// Rota para atualizar atendimento com anexos
|
||||
router.patch("/:id", async (req, res) => {
|
||||
router.patch("/:id", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { anexos, ...data } = req.body;
|
||||
@@ -329,7 +329,7 @@ router.patch("/:id", async (req, res) => {
|
||||
});
|
||||
|
||||
// Nova rota para upload de arquivo via proxy
|
||||
router.post("/upload", upload.single("file"), async (req, res) => {
|
||||
router.post("/upload", upload.single("file"), async (req: Request, res: Response) => {
|
||||
try {
|
||||
if (!req.file || !req.body.clienteNome) {
|
||||
return res
|
||||
@@ -359,7 +359,7 @@ router.post("/upload", upload.single("file"), async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.get("/:id", async (req, res) => {
|
||||
router.get("/:id", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
|
||||
|
||||
Reference in new issue
Block a user