Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored controllers to require <tag>Service #1106

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

Matte22
Copy link
Collaborator

@Matte22 Matte22 commented Oct 12, 2023

Resolves: #1096

All controllers have been improved for clarity/readability when calling their service.

FROM:
const Asset = require(../service/${config.database.type}/AssetService);

TO:
const AssetService = require(../service/${config.database.type}/AssetService);

By renaming the variable to AssetService, it becomes evident that this is sourced from our service.

@@ -2,7 +2,7 @@

const writer = require('../utils/writer');
const config = require('../utils/config')
const Asset = require(`../service/${config.database.type}/AssetService`);
const AssetService = require(`../service/${config.database.type}/AssetService`);
const Collection = require(`../service/${config.database.type}/CollectionService`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collection -> CollectionService

@@ -2,7 +2,7 @@

const writer = require('../utils/writer')
const config = require('../utils/config')
const CollectionSvc = require(`../service/${config.database.type}/CollectionService`)
const CollectionService = require(`../service/${config.database.type}/CollectionService`)
const AssetSvc = require(`../service/${config.database.type}/AssetService`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AssetSvc -> AssetService
StigSvc -> STIGService

@@ -1,7 +1,7 @@
'use strict';

const config = require('../utils/config')
const User = require(`../service/${config.database.type}/UserService`)
const UserService = require(`../service/${config.database.type}/UserService`)
const Asset = require(`../service/${config.database.type}/AssetService`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asset -> AssetService
Collection -> CollectionService

Copy link
Collaborator

@cd-rite cd-rite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@cd-rite cd-rite merged commit 1df8fa0 into NUWCDIVNPT:main Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants