Skip to content

Commit

Permalink
feat: create all fields of coordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcarvalhoj committed Mar 8, 2024
1 parent f4ae917 commit ac943cb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/routes/coordinate.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ coordRouter.post("/", async (req: Request, res: Response) => {
}
});

coordRouter.post("/all", async (req: Request, res: Response) => {
try {
const { lat, lng, createdAt } = req.body;
const id = uuidv4();
const data = await coordController.createCoordinate({
id,
lat,
lng,
createdAt,
});
res.status(200).send(data);
} catch (error) {
res.status(500).send(error);
}
});

coordRouter.delete("/:id", async (req: Request, res: Response) => {
try {
const id = req.params.id;
Expand Down

0 comments on commit ac943cb

Please sign in to comment.