- Fix Title is required by setting Checklist title

during migration.

Thanks to centigrade-kdk and xet7 !

Closes #1576,
closes #1753
This commit is contained in:
Lauri Ojansivu 2018-07-06 16:14:07 +03:00
parent 369da1e09d
commit 7683f98b7b
2 changed files with 1 additions and 2 deletions

View file

@ -7,7 +7,6 @@ Checklists.attachSchema(new SimpleSchema({
title: { title: {
type: String, type: String,
defaultValue: 'Checklist', defaultValue: 'Checklist',
optional: true,
}, },
finishedAt: { finishedAt: {
type: Date, type: Date,

View file

@ -184,7 +184,7 @@ Migrations.add('add-checklist-items', () => {
// Create new items // Create new items
_.sortBy(checklist.items, 'sort').forEach((item, index) => { _.sortBy(checklist.items, 'sort').forEach((item, index) => {
ChecklistItems.direct.insert({ ChecklistItems.direct.insert({
title: item.title, title: (item.title ? item.title : 'Checklist'),
sort: index, sort: index,
isFinished: item.isFinished, isFinished: item.isFinished,
checklistId: checklist._id, checklistId: checklist._id,