Skip to content

Commit

Permalink
prettir
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-elhaddad committed Oct 12, 2023
1 parent 84f18ef commit c2b7c2d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/controllers/lists.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export const getLists = async (req: Request, res: Response, next: NextFunction)
res.locals.err = err;
next();
}
}
};
4 changes: 2 additions & 2 deletions src/models/lists.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import List from "../types/List.type";
import prisma from "../lib/database";
import List from '../types/List.type';
import prisma from '../lib/database';

class Lists {
static async createList(list: List) {
Expand Down
10 changes: 5 additions & 5 deletions src/routes/api/listRouter.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Application } from "express";
import authenticate from "../../middlewares/authenticate.middleware";
import { createList, getLists } from "../../controllers/lists.controller";
import errorHandler from "../../middlewares/errorHandler.middleware";
import { Application } from 'express';
import authenticate from '../../middlewares/authenticate.middleware';
import { createList, getLists } from '../../controllers/lists.controller';
import errorHandler from '../../middlewares/errorHandler.middleware';

const listRouter = (app: Application) => {
app.post('/lists', authenticate, createList, errorHandler);
app.get('/lists', authenticate, getLists, errorHandler);
};

export default listRouter
export default listRouter;
10 changes: 5 additions & 5 deletions src/types/List.type.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
type List = {
l_title: string,
l_id?: number,
l_created_at?: Date,
l_user_id: number,
}
l_title: string;
l_id?: number;
l_created_at?: Date;
l_user_id: number;
};

export default List;

0 comments on commit c2b7c2d

Please sign in to comment.