How to use the bookbrainz-data.TitleType function in bookbrainz-data

To help you get started, we’ve selected a few bookbrainz-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bookbrainz / bookbrainz-site / src / server / routes / achievement.js View on Github external
name: editorJSON.name
				}
			});
		});

	const AchievementJSONPromise = new AchievementType()
		.orderBy('name')
		.fetchAll()
		.then((achievements) => {
			const achievementList = achievements.toJSON();
			achievementList.unshift({id: 'none', name: 'No Achievement'});
			console.log(achievementList);
			return achievementList;
		});

	const TitleJSONPromise = new TitleType()
		.orderBy('title')
		.fetchAll()
		.then((titles) => {
			const titleList = titles.toJSON();
			titleList.unshift({id: 'none', title: 'No Title'});
			return titleList;
		});

	Promise.join(EditorJSONPromise,
		AchievementJSONPromise,
		TitleJSONPromise,
		(editorJSON, achievementJSON, titleJSON) => {
			const props = {
				editor: editorJSON,
				achievement: achievementJSON,
				title: titleJSON