Refactor routes and views for improved clarity and functionality
- Commented out console log in the home route to reduce clutter in logs. - Updated formatting and consistency in the sites route, including removing unused domain fetching functionality. - Added form action to the add-form view for submitting new sites, ensuring the input field is properly named for backend processing.
This commit is contained in:
@@ -11,10 +11,10 @@ class SiteModel {
|
||||
|
||||
/**
|
||||
* Inserts a new site into the database.
|
||||
*
|
||||
*
|
||||
* @param {string} name - The name of the site.
|
||||
* @param {string} domainName - The domain name of the site.
|
||||
*
|
||||
*
|
||||
* @returns {Promise<Object>} - The result of the insert operation.
|
||||
*/
|
||||
async insert(domainName) {
|
||||
@@ -47,7 +47,7 @@ class SiteModel {
|
||||
|
||||
/**
|
||||
* Retrieves all sites from the database.
|
||||
*
|
||||
*
|
||||
* @returns {Promise<Array>} - An array of site objects.
|
||||
*/
|
||||
async getAll() {
|
||||
@@ -63,9 +63,9 @@ class SiteModel {
|
||||
|
||||
/**
|
||||
* Retrieves a site by its ID.
|
||||
*
|
||||
*
|
||||
* @param {number} id - The ID of the site.
|
||||
*
|
||||
*
|
||||
* @returns {Promise<Object>} - The site object.
|
||||
*/
|
||||
async getById(id) {
|
||||
@@ -81,9 +81,9 @@ class SiteModel {
|
||||
|
||||
/**
|
||||
* Retrieves a site by its domain name.
|
||||
*
|
||||
*
|
||||
* @param {string} domainName - The domain name of the site.
|
||||
*
|
||||
*
|
||||
* @returns {Promise<Object>} - The site object.
|
||||
*/
|
||||
async getByDomainName(domainName) {
|
||||
@@ -99,4 +99,4 @@ class SiteModel {
|
||||
|
||||
}
|
||||
|
||||
module.exports = SiteModel;
|
||||
module.exports = SiteModel;
|
||||
|
||||
Reference in New Issue
Block a user