in public/components/content-list-drawer/content-list-drawer.js [451:474]
$scope.pickBookSection = function (bookSectionTag) {
const getNewspaperBook = wfTagApiService.getHyperTag(bookSectionTag.parents[0]);
getNewspaperBook.then(function (book) {
if (book.data.type !== 'Newspaper Book') {
throw new Error('The parent for this newspaper book section is not a valid newspaper book.');
}
const getPublication = wfTagApiService.getHyperTag(book.data.parents[0]);
getPublication.then(function (publication) {
if (publication.data.type !== 'Publication') {
throw new Error('The parent for this newspaper book is not a valid publication.');
}
updateField("plannedBookId", book.data.id, $scope.plannedBookId)
updateField("plannedBookSectionId", bookSectionTag.id, $scope.plannedBookSectionId)
updateField("plannedPublicationId", publication.data.id, $scope.plannedPublicationId)
$scope.showBookTagPicker = false;
$scope.editedShortPlannedPrintLocationDescription = `${bookSectionTag.internalName}`
});
});
delete $scope.candidateBookSections;
delete $scope.bookSectionQuery;
};