Compare commits

...

3 Commits

Author SHA1 Message Date
36ad90eda6
feat(controllers): Refactor AuthController and update router reference
- Revised comments replacing 'TODO' with 'FIX' and 'FEAT' in AuthController.
- Renamed 'AuthController.ts' to 'auth.controller.ts' and updated the reference in the router.
- Planned for implementing re-auth by current password in case of password change.

Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 14:23:13 +02:00
73e086be44
docs(services): add TODO comment in mysql.service
A TODO comment has been added in the mysql.service.ts file as a reminder to get models in category in the future. This is to ensure that future development accounts for this necessity.

Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 14:22:25 +02:00
a582f8c431
docs(services): add comment for future improvement in category service
A comment has been added in the category service to return the new id in the future. Currently, the implementation returns a boolean value after creating a new category, but there is a plan to update this to return the generated id.

Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 14:22:02 +02:00
4 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import {Logger} from "tslog";
const logger = new Logger({ name: "AuthController" });
//TODO Better return object interface
//FIX Better return object interface
/**
* Registers a user with the given request data.
*
@ -232,7 +232,7 @@ async function getUser(req: Request, res: Response) {
.json(dbUser);
}
//TODO - Implement re-auth by current password in case of password change
//FEAT - Implement re-auth by current password in case of password change
async function editUser(req: Request, res: Response) {
const body: IReqEditUserData | null = req.body;
if (!body) {

View File

@ -1,7 +1,7 @@
import express, {type Router} from "express";
import UserGuard from "@validators/UserGuard";
import AdminGuard from "@validators/AdminGuard";
import AuthController from "@controllers/AuthController";
import AuthController from "@controllers/auth.controller";
const router: Router = express.Router();

View File

@ -24,6 +24,7 @@ async function createCategory(data: IDbCategory): Promise<boolean> {
display_name: data.display_name,
slug_name: data.slug_name
})
//TODO Return the new id
return true;
} catch (error) {
logger.error(`Error creating category: ${error}`);

View File

@ -475,6 +475,7 @@ const MySqlService = {
}
})
}
//TODO Get models in category
}
}