editOneThing(itemFields.shift());
}
- showEditDialog(course_material: IdlObject): Promise<any> {
+ showEditDialog(courseMaterial: IdlObject): Promise<any> {
this.editDialog.mode = 'update';
- this.editDialog.recordId = course_material._id;
+ this.editDialog.recordId = courseMaterial.id();
return new Promise((resolve, reject) => {
this.editDialog.open({size: 'lg'}).subscribe(
result => {
.then(str => this.toast.success(str));
this.pcrud.retrieve('acmcm', result).subscribe(material => {
if (material.course() !== this.courseId) {
- this.materialsDataSource.data.splice(
- this.materialsDataSource.data.indexOf(course_material, 0), 1
- );
+ this.materialsGrid.reload();
} else {
- course_material._relationship = material.relationship();
+ courseMaterial.relationship = material.relationship();
}
});
resolve(result);