6 Commits

Author SHA1 Message Date
4a9bc402b4
feat(services): change return type in createCategory function
The return type of the createCategory function in category.service.ts has been changed from unknown to boolean. Now, the function will return true if the creation is successful, and false if an error occurs.

Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 14:11:15 +02:00
f3cd6c5985
fix(services): correct MysqlService method calls in category.service.ts
Several method calls in category.service.ts were incorrectly using IDbCategory instead of Category in MysqlService. This commit fixes the naming to correctly use Category in all method calls to ensure correct function execution.

Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 14:00:07 +02:00
325c6ec6a0
feat(services): update methods in category service
Refactor the category service by:
- Calling methods from MysqlService.IDbCategory instead of MysqlService.Category.
- Adding new methods: getById and deleteCategory with typed return and clear comments.
These changes enhances code flexibility and readability.

Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 13:55:55 +02:00
11be3a40c3
feat(services): update category service functions
Update category service functions with added getBySlug function and refactor getAllCategory to getAll. Exception handling has been improved, returning null on error.

Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 13:50:45 +02:00
3d3bc8580a
feat(services): update category.service with improved UUID usage and new function
The commit updates the 'category.service.ts' file by refactoring the UUID usage. Previously, the UUID feature was imported as a whole, but now only the v4 function is imported for efficiency. It introduces a new function 'getAllCategory' to fetch all categories. This, combined with better error handling and logging, leads to improved service reliability.

Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 13:46:08 +02:00
38b6b05190
feat(services): add CategoryService with createCategory function
A new CategoryService has been added in the services layer. This includes a function createCategory for creating a new category using IDbCategory data. Some placeholders for future features such as get, delete and retrieve by id or slug are also included.

Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 13:33:09 +02:00