Skip to content
Snippets Groups Projects
Commit 89418175 authored by alrwasheda's avatar alrwasheda :speech_balloon:
Browse files

showAllBoats Controller

parent 59a075d6
No related branches found
No related tags found
No related merge requests found
import { Request, Response } from "express";
import Boat from "../db/models/Boat";
const showAllBoatsController = async (req: Request, res: Response) => {
try {
const allBoats = await Boat.findAll();
return res.status(200).send({ success: true, allBoats });
} catch (error) {
console.error("server error: ", error.message);
return res.status(500).json({ success: false, error: "serverError" });
}
};
const boatControllers = { showAllBoatsController };
export default boatControllers;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment