hack4impact-uiuc / 7000-languages

Helping Indigenous communities around the world teach, learn and sustain their languages
GNU General Public License v3.0
12 stars 2 forks source link

Make L1 Text and L2 Audio Mandatory #290

Closed ashayp22 closed 1 year ago

ashayp22 commented 1 year ago

Right now, only the L1 and L2 text is required for a Vocab Item stored in MongoDB. We need to make L1 Audio and L2 Text required. The simple fix is going into the VocabItem schema and making the following change:

Before:

const Vocab = new mongoose.Schema({
  _order: { type: Number, required: true, index: true },
  original: { type: String, required: true },
  translation: { type: String, required: true },
  image: { type: String, required: false, default: '' },
  audio: { type: String, required: false, default: '' },
  selected: { type: Boolean, required: true, default: true },
  notes: { type: String, required: false, default: '' },
});

After:

const Vocab = new mongoose.Schema({
  _order: { type: Number, required: true, index: true },
  original: { type: String, required: false },
  translation: { type: String, required: true },
  image: { type: String, required: false, default: '' },
  audio: { type: String, required: true, default: '' },
  selected: { type: Boolean, required: true, default: true },
  notes: { type: String, required: false, default: '' },
});

However, there is a good chance that this is going to break all of the our developer's apps since Mongoose will start complaining about a whole lot of vocab items stored in our Development Database that don't have audio files.

For now, let's wait till closer to Product Showcase or after Product Showcase before making this switch. We'll also have to clear the Development Database before doing this.