Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Apr 9, 2022
1 parent b9b67d2 commit c7702e0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/api/components/cameras/cameras.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const getByName = async (req, res) => {

export const patchByName = async (req, res) => {
try {
if (req.body === undefined) {
if (req.body === undefined || Object.keys(req?.body).length === 0) {
return res.status(400).send({
statusCode: 400,
message: 'Bad request',
Expand Down
2 changes: 1 addition & 1 deletion src/api/components/config/config.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const show = async (req, res) => {

export const patchConfig = async (req, res) => {
try {
if (req.body === undefined) {
if (req.body === undefined || Object.keys(req?.body).length === 0) {
return res.status(400).send({
statusCode: 400,
message: 'Bad request',
Expand Down
2 changes: 1 addition & 1 deletion src/api/components/settings/settings.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const getTarget = async (req, res) => {

export const patchTarget = async (req, res) => {
try {
if (req.body === undefined) {
if (req.body === undefined || Object.keys(req?.body).length === 0) {
return res.status(400).send({
statusCode: 400,
message: 'Bad request',
Expand Down
2 changes: 1 addition & 1 deletion src/api/components/users/users.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const patchByName = async (req, res) => {
req.body.photo = req.file.filename;
}

if (req.body === undefined) {
if (req.body === undefined || Object.keys(req?.body).length === 0) {
return res.status(400).send({
statusCode: 400,
message: 'Bad request',
Expand Down
1 change: 1 addition & 0 deletions src/services/config/config.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default class ConfigService {
static logPath;
static logFile;
static recordingsPath;
static reportsPath;

static debugEnabled;
static version;
Expand Down
1 change: 1 addition & 0 deletions test/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ process.env.CUI_STORAGE_DATABASE_FILE = path.resolve(storagePath, 'database', 'd
process.env.CUI_STORAGE_LOG_PATH = path.resolve(storagePath, 'logs');
process.env.CUI_STORAGE_LOG_FILE = path.resolve(storagePath, 'logs', 'camera.ui.log');
process.env.CUI_STORAGE_RECORDINGS_PATH = path.resolve(storagePath, 'recordings');
process.env.CUI_STORAGE_REPORTS_PATH = path.resolve(storagePath, 'reports');

process.env.CUI_MODULE_NAME = moduleName;
process.env.CUI_MODULE_VERSION = packageJson.version;
Expand Down

0 comments on commit c7702e0

Please sign in to comment.