Skip to content

Commit

Permalink
refactor: get default_locale and locales from @lykmapipo/env
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkerd committed Apr 10, 2019
1 parent 0921f7f commit 9ca263e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/priority.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ const randomColor = require('randomcolor');
const mongoose = require('mongoose');
const localize = require('mongoose-locale-schema');
const actions = require('mongoose-rest-actions');
const { env, schema, models } = require('@codetanzania/majifix-common');
const { schema, models } = require('@codetanzania/majifix-common');
const { getString, getStrings } = require('@lykmapipo/env');
const { Jurisdiction } = require('@codetanzania/majifix-jurisdiction');
const { Schema } = mongoose;
const { ObjectId } = Schema.Types;


/* local constants */
const { DEFAULT_LOCALE } = env;
const DEFAULT_LOCALE = getString('DEFAULT_L0CALE','en');
const JURISDICTION_PATH = 'jurisdiction';
const SCHEMA_OPTIONS = ({ timestamps: true, emitIndexErrors: true });
const OPTION_AUTOPOPULATE = {
Expand All @@ -51,7 +52,7 @@ const {


/* declarations */
let locales = env.LOCALES;
let locales = getStrings('LOCALES',['en']);
locales = _.map(locales, function (locale) {
let option = { name: locale };
if (locale === DEFAULT_LOCALE) {
Expand Down

0 comments on commit 9ca263e

Please sign in to comment.