setup for ingredient and grocery routes
This commit is contained in:
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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) => {
|
||||
|
||||
})
|
||||
}
|
||||
22
server/routes/ingredient.ts
Normal file
22
server/routes/ingredient.ts
Normal file
@@ -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) => {
|
||||
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user