From 1d7115209830a13daf5e9fa0c5c8a63ffb6dd47f Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Wed, 1 Dec 2021 01:57:04 +0000 Subject: [PATCH] fix: rename benefits --- .../co-benefits.mock.js} | 4 ++-- .../co-benefits.model.js} | 4 ++-- .../co-benefits.stub.json} | 0 src/models/co-benefits/index.js | 2 ++ src/models/co-benifets/index.js | 2 -- src/models/index.js | 2 +- src/routes/v1/index.js | 4 ++-- src/routes/v1/resources/co-benefits.js | 12 ++++++------ 8 files changed, 15 insertions(+), 15 deletions(-) rename src/models/{co-benifets/co-benifets.mock.js => co-benefits/co-benefits.mock.js} (57%) rename src/models/{co-benifets/co-benifets.model.js => co-benefits/co-benefits.model.js} (64%) rename src/models/{co-benifets/co-benifets.stub.json => co-benefits/co-benefits.stub.json} (100%) create mode 100644 src/models/co-benefits/index.js delete mode 100644 src/models/co-benifets/index.js diff --git a/src/models/co-benifets/co-benifets.mock.js b/src/models/co-benefits/co-benefits.mock.js similarity index 57% rename from src/models/co-benifets/co-benifets.mock.js rename to src/models/co-benefits/co-benefits.mock.js index 154ad191..55e27718 100644 --- a/src/models/co-benifets/co-benifets.mock.js +++ b/src/models/co-benefits/co-benefits.mock.js @@ -1,6 +1,6 @@ -import stub from './co-benifets.stub.json'; +import stub from './co-benefits.stub.json'; -export const CoBenifetsMock = { +export const CoBenefitsMock = { findAll: () => stub, findOne: (id) => { return stub.find((record) => record.id == id); diff --git a/src/models/co-benifets/co-benifets.model.js b/src/models/co-benefits/co-benefits.model.js similarity index 64% rename from src/models/co-benifets/co-benifets.model.js rename to src/models/co-benefits/co-benefits.model.js index 9dc570bf..46f29a48 100644 --- a/src/models/co-benifets/co-benifets.model.js +++ b/src/models/co-benefits/co-benefits.model.js @@ -1,9 +1,9 @@ 'use strict'; -class CoBenifets { +class CoBenefits { static list(page = 0, limit = 10) { return stub; } } -export { CoBenifets }; +export { CoBenefits }; diff --git a/src/models/co-benifets/co-benifets.stub.json b/src/models/co-benefits/co-benefits.stub.json similarity index 100% rename from src/models/co-benifets/co-benifets.stub.json rename to src/models/co-benefits/co-benefits.stub.json diff --git a/src/models/co-benefits/index.js b/src/models/co-benefits/index.js new file mode 100644 index 00000000..3b8b1b82 --- /dev/null +++ b/src/models/co-benefits/index.js @@ -0,0 +1,2 @@ +export * from './co-benefits.model.js'; +export * from './co-benefits.mock.js'; diff --git a/src/models/co-benifets/index.js b/src/models/co-benifets/index.js deleted file mode 100644 index 277dfdd3..00000000 --- a/src/models/co-benifets/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './co-benifets.model'; -export * from './co-benifets.mock'; diff --git a/src/models/index.js b/src/models/index.js index e6d6d1c6..dae27e3f 100644 --- a/src/models/index.js +++ b/src/models/index.js @@ -1,5 +1,5 @@ export * from './projects'; -export * from './co-benifets'; +export * from './co-benefits'; export * from './locations'; export * from './ratings'; export * from './qualifications'; diff --git a/src/routes/v1/index.js b/src/routes/v1/index.js index a0a3a1da..348d2cd9 100644 --- a/src/routes/v1/index.js +++ b/src/routes/v1/index.js @@ -6,7 +6,7 @@ const V1Router = express.Router(); import { ProjectRouter, UnitRouter, - CoBenifetRouter, + CoBenefitRouter, LocationRouter, QualificationRouter, RatingRouter, @@ -16,7 +16,7 @@ import { V1Router.use('/projects', ProjectRouter); V1Router.use('/units', UnitRouter); -V1Router.use('/co-benifets', CoBenifetRouter); +V1Router.use('/co-benefits', CoBenefitRouter); V1Router.use('/locations', LocationRouter); V1Router.use('/qualifications', QualificationRouter); V1Router.use('/ratings', RatingRouter); diff --git a/src/routes/v1/resources/co-benefits.js b/src/routes/v1/resources/co-benefits.js index b4ce19e3..b43bf25c 100644 --- a/src/routes/v1/resources/co-benefits.js +++ b/src/routes/v1/resources/co-benefits.js @@ -2,16 +2,16 @@ import express from 'express'; import { CoBenefitController } from '../../../controllers'; -const CoBenifetRouter = express.Router(); +const CoBenefitRouter = express.Router(); -CoBenifetRouter.get('/', (req, res) => { +CoBenefitRouter.get('/', (req, res) => { return req.query.id ? CoBenefitController.findOne(req, res) : CoBenefitController.findAll(req, res); }); -CoBenifetRouter.post('/', CoBenefitController.create); -CoBenifetRouter.put('/', CoBenefitController.update); -CoBenifetRouter.delete('/', CoBenefitController.destroy); +CoBenefitRouter.post('/', CoBenefitController.create); +CoBenefitRouter.put('/', CoBenefitController.update); +CoBenefitRouter.delete('/', CoBenefitController.destroy); -export { CoBenifetRouter }; +export { CoBenefitRouter };