async function update_page_type({ entries, fields }) {
	const original_page_type = _.cloneDeep(get(stores.page_type))
	const page_type_id = get(stores.page_type).id

	const changes = {
		entries: db_utils.generate_entry_changes(original_page_type.entries, entries),
		fields: db_utils.generate_field_changes(original_page_type.fields, fields),
	}

	db_utils.remap_entries_and_fields({
		changes: {
			fields: changes.fields,
			entries: changes.entries
		},
		items: {
			fields,
			entries
		}
	})

	stores.page_type.update((store) => ({ ...store, entries, fields }))

	await helpers.handle_field_changes_new(changes.fields, { page_type: page_type_id })
	await helpers.handle_content_changes_new(changes.entries, {
		page_type: page_type_id
	})

	// DB: update page type instances
	const pages_of_type = await dataChanged({
		table: 'pages',
		action: 'select',
		data: 'id, entries(*)',
		match: { page_type: page_type_id }
	})

	// modify entries for pages instances
	await Promise.all(pages_of_type.map(async ({ id: page_id, entries }) => {
		const synced = helpers.sync_page_content_with_field_changes({
			page_entries: entries,
			field_changes: changes.fields,
			original_fields: original_page_type.fields,
			updated_fields: fields
		})
		await helpers.handle_content_changes_new(synced.changes, { page: page_id })
	}))

}
@param {{ id: string, name: string, color: string, icon: string }} pt_options