From 21db95b6241e8d721a73b26c4ef3b14f14569cb6 Mon Sep 17 00:00:00 2001 From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com> Date: Sat, 19 Nov 2022 12:23:23 -0600 Subject: [PATCH] setup for ingredient and grocery routes --- server/controllers/GroceryListCtl.ts | 21 +++++++++++++++++++++ server/controllers/IngredientCtl.ts | 21 +++++++++++++++++++++ server/models/groceryList.ts | 20 ++++++++++++++++++++ server/models/ingredient.ts | 20 ++++++++++++++++++++ server/routes/groceryList.ts | 23 +++++++++++++++++++++++ server/routes/ingredient.ts | 22 ++++++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 server/routes/ingredient.ts diff --git a/server/controllers/GroceryListCtl.ts b/server/controllers/GroceryListCtl.ts index e69de29..2f788de 100644 --- a/server/controllers/GroceryListCtl.ts +++ b/server/controllers/GroceryListCtl.ts @@ -0,0 +1,21 @@ +import { IGroceryList } from "../schemas"; +import { GroceryList } from "../models/groceryList"; +const GroceryInstance = new GroceryList(); + +export default class GroceryListCtl { + async getAll() { + + } + + async getOne(id: string) { + + } + + async post(data: IGroceryList) { + + } + + async put(id: string, data: IGroceryList) { + + } +} \ No newline at end of file diff --git a/server/controllers/IngredientCtl.ts b/server/controllers/IngredientCtl.ts index e69de29..21b16eb 100644 --- a/server/controllers/IngredientCtl.ts +++ b/server/controllers/IngredientCtl.ts @@ -0,0 +1,21 @@ +import { IIngredient } from "../schemas"; +import { Ingredient } from "../models/ingredient"; +const IngredientInstance = new Ingredient(); + +export default class IngredientCtl { + async getAll() { + + } + + async getOne(id: string) { + + } + + async post(data: IIngredient) { + + } + + async put(id: string, data: IIngredient) { + + } +} \ No newline at end of file diff --git a/server/models/groceryList.ts b/server/models/groceryList.ts index e69de29..99b1777 100644 --- a/server/models/groceryList.ts +++ b/server/models/groceryList.ts @@ -0,0 +1,20 @@ +import { IGroceryList } from "../schemas"; +import pool from "../db"; + +export class GroceryList { + async getAll() { + + } + + async getOne(id: string) { + + } + + async post(data: IGroceryList) { + + } + + async put(id: string, data: IGroceryList) { + + } +} \ No newline at end of file diff --git a/server/models/ingredient.ts b/server/models/ingredient.ts index e69de29..737e8b0 100644 --- a/server/models/ingredient.ts +++ b/server/models/ingredient.ts @@ -0,0 +1,20 @@ +import { IIngredient } from "../schemas"; +import pool from "../db"; + +export class Ingredient { + async getAll() { + + } + + async getOne(id: string) { + + } + + async post(data: IIngredient) { + + } + + async put(id: string, data: IIngredient) { + + } +} \ No newline at end of file diff --git a/server/routes/groceryList.ts b/server/routes/groceryList.ts index e69de29..1ba4bf3 100644 --- a/server/routes/groceryList.ts +++ b/server/routes/groceryList.ts @@ -0,0 +1,23 @@ +import { Express, Router } from "express"; + +const router = Router(); + +export const groceryListRoute = (app: Express) => { + app.use('/grocery-list', router); + + router.get('/', async (req, res, next) => { + + }) + + router.get('/:id', async (req, res, next) => { + + }) + + router.post('/', async (req, res, next) => { + + }) + + router.put('/:id', async (req, res, next) => { + + }) +} \ No newline at end of file diff --git a/server/routes/ingredient.ts b/server/routes/ingredient.ts new file mode 100644 index 0000000..03942d5 --- /dev/null +++ b/server/routes/ingredient.ts @@ -0,0 +1,22 @@ +import { Express, Router } from "express"; +const router = Router(); + +export const ingredientRoute = (app: Express) => { + app.use('/ingredient', router); + + router.get('/', async (req, res, next) => { + + }) + + router.get('/:id', async (req, res, next) => { + + }) + + router.put('/:id', async (req, res, next) => { + + }) + + router.post('/', async (req, res, next) => { + + }) +} \ No newline at end of file