Compare commits

...

2 Commits

Author SHA1 Message Date
25b573d3a4
feat(others): enhance VCS XML with commit message inspection tools
This commit augments the VCS XML with "CommitMessageInspectionProfile". It enables two inspection tools: "CommitFormat" and "CommitNamingConvention", meant to enforce commit standards and conventions within the project. These tools will raise a warning when they detect a violation.

Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 12:20:31 +02:00
02383b8c8a
feat(services): add getAll function to mysql service
This commit adds a new `getAll` function in the `mysql.service.ts` file, which retrieves all categories from the database. It executes a SQL query and includes error handling that either resolves with an array of category objects or rejects with an Error object.

BREAKING-CHANGE: #6
Signed-off-by: Mathis <yidhra@tuta.io>
2024-04-25 12:18:33 +02:00
2 changed files with 25 additions and 1 deletions

6
.idea/vcs.xml generated
View File

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>

View File

@ -402,7 +402,25 @@ const MySqlService = {
}
})
},
/**
* Retrieves all categories from the database.
*
* @param {MysqlHandler} handler - The MySQL handler used for executing the query.
*
* @return {Promise<Array<IDbCategory>>} - A promise that resolves with an array of category objects from the database.
* - The category objects are of type IDbCategory.
* - If an error occurs, the promise will be rejected with an Error object.
*/
getAll(handler: MysqlHandler) {
return new Promise((resolve, reject) => {
const _sql = "SELECT * FROM `categories`";
try {
resolve(handler.query(_sql) as unknown as Array<IDbCategory>);
} catch (err: unknown) {
reject(err as Error);
}
});
}
}
}