Creating admin pages, new brand API endpoint
This commit is contained in:
12
software/backend/routes/brand.routes.ts
Normal file
12
software/backend/routes/brand.routes.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Brand } from "../models/brand.model"
|
||||
import { Request, Router, Response } from "express"
|
||||
|
||||
export const brand = Router()
|
||||
|
||||
// Get all brands
|
||||
brand.get("/", (req: Request, res: Response) => {
|
||||
Brand.findAll()
|
||||
.then(brands => {
|
||||
res.status(200).json(brands)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user