Merge branch 'master' of github.com:kevinmidboe/seasonedShows
This commit is contained in:
@@ -27,6 +27,11 @@ class Config {
|
||||
|
||||
const field = new Field(this.fields[section][option])
|
||||
|
||||
if (field.value === '') {
|
||||
const envField = process.env[[section.toUpperCase(), option.toUpperCase()].join('_')]
|
||||
if (envField !== undefined && envField.length !== 0) { return envField }
|
||||
}
|
||||
|
||||
if (field.value === undefined) {
|
||||
throw new Error(`${section} => ${option} is empty.`);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ const EnvironmentVariables = require('./environmentVariables.js');
|
||||
class Field {
|
||||
|
||||
constructor(rawValue, environmentVariables) {
|
||||
this.rawValue, rawValue;
|
||||
this.rawValue = rawValue;
|
||||
this.filters = new Filters(rawValue);
|
||||
this.valueWithoutFilters = this.filters.removeFiltersFromValue();
|
||||
this.environmentVariables = new EnvironmentVariables(environmentVariables);
|
||||
|
||||
@@ -10,7 +10,7 @@ class Filters {
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
return !this.hasValidType() || this.filters.length === 0;
|
||||
return !this.hasValidType() || this.value.length === 0;
|
||||
}
|
||||
|
||||
has(filter) {
|
||||
|
||||
3
seasoned_api/src/database/schemas/teardown.sql
Normal file
3
seasoned_api/src/database/schemas/teardown.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DROP TABLE IF EXISTS user;
|
||||
DROP TABLE IF EXISTS search_history;
|
||||
DROP TABLE IF EXISTS requests;
|
||||
@@ -69,6 +69,15 @@ class SqliteDatabase {
|
||||
return this.execute(setupSchema);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the database by running tearDown.sql file in schemas/.
|
||||
* @returns {Promise}
|
||||
*/
|
||||
tearDown() {
|
||||
const tearDownSchema = this.readSqlFile('tearDown.sql');
|
||||
return this.execute(tearDownSchema);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file contents of a SQL file in schemas/.
|
||||
* @returns {String}
|
||||
|
||||
Reference in New Issue
Block a user