diff --git a/src/services/category.service.ts b/src/services/category.service.ts index 1d47ea7..f78d8aa 100644 --- a/src/services/category.service.ts +++ b/src/services/category.service.ts @@ -19,7 +19,7 @@ const logger = new Logger({name: 'CategoryService'}) async function createCategory(data: IDbCategory): Promise { logger.info(`Creating a new category... (${data.display_name})`) try { - return await MysqlService.IDbCategory.insert(DbHandler, { + return await MysqlService.Category.insert(DbHandler, { id: uuidv4(), display_name: data.display_name, slug_name: data.slug_name @@ -38,7 +38,7 @@ async function createCategory(data: IDbCategory): Promise { async function getAll(): Promise> | null> { try { logger.info("Getting all categories..."); - return await MysqlService.IDbCategory.getAll(DbHandler); + return await MysqlService.Category.getAll(DbHandler); } catch (error) { logger.error(`Error getting all categories: ${error}`); return null; @@ -55,7 +55,7 @@ async function getAll(): Promise> | null> { async function getBySlug(slug: string): Promise { try { logger.info(`Getting category by slug... (${slug})`); - return await MysqlService.IDbCategory.getBySlug(DbHandler, slug); + return await MysqlService.Category.getBySlug(DbHandler, slug); } catch (error) { logger.error(`Error getting category by slug: ${error}`); return null; @@ -71,7 +71,7 @@ async function getBySlug(slug: string): Promise { async function getById(id: string):Promise { try { logger.info(`Getting category by id... (${id})`); - return await MysqlService.IDbCategory.getById(DbHandler, id); + return await MysqlService.Category.getById(DbHandler, id); } catch (error) { logger.error(`Error getting category by id: ${error}`); return null; @@ -90,7 +90,7 @@ async function getById(id: string):Promise { async function deleteCategory(id:string): Promise { try { logger.info(`Deleting category... (${id})`); - return await MysqlService.IDbCategory.delete(DbHandler, id); + return await MysqlService.Category.delete(DbHandler, id); } catch (error) { logger.error(`Error deleting category: ${error}`); return null;