-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
api/source/controllers/Asset.js
Outdated
@@ -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`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collection -> CollectionService
api/source/controllers/Collection.js
Outdated
@@ -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`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AssetSvc -> AssetService
StigSvc -> STIGService
api/source/controllers/User.js
Outdated
@@ -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`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asset -> AssetService
Collection -> CollectionService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
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.