defined a form class
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user