defined a form class

This commit is contained in:
Mikayla Dobson
2022-11-21 13:39:17 -06:00
parent 57a16e429e
commit 48f6a60e77
10 changed files with 195 additions and 26 deletions

View File

@@ -12,6 +12,7 @@ export const authRoute = (app: Express, passport: PassportStatic) => {
router.post('/login', passport.authenticate('local'), async (req, res, next) => {
try {
const data: IUserAuth = req.body;
console.log(data);
const response = await AuthInstance.login(data);
res.status(200).send(response);
} catch(e) {

View File

@@ -1,5 +1,5 @@
export interface IUser {
id: number
id?: number
firstname: string
lastname: string
handle: string
@@ -9,34 +9,34 @@ export interface IUser {
}
export interface IRecipe {
id: number
id?: number
name: string
description?: string
preptime: string
removed: boolean
authoruserid: IUser["id"]
authoruserid?: IUser["id"]
}
export interface IIngredient {
id: number
id?: number
name: string
description?: string
}
export interface ICollection {
id: number
id?: number
name: string
active: string
ismaincollection: boolean
ownerid: IUser["id"]
ownerid?: IUser["id"]
}
export interface IGroceryList {
id: number
id?: number
name: string
recipes?: IRecipe["id"][]
active: boolean
ownerid: IUser["id"]
ownerid?: IUser["id"]
}
export interface IUserAuth {