@tanglemedia/directus-collection-modal
Version:
Installs the Modal Collection to your Directus project.
43 lines (38 loc) • 825 B
JavaScript
const MODAL_TABLE = "tngl_modal";
export async function up(knex) {
const hasContentField = await knex("directus_fields")
.where({
collection: MODAL_TABLE,
field: "content",
})
.first();
// remove h1 tag from available choices of tools
if (hasContentField?.id) {
const currentOptions = hasContentField?.options;
const availableTools = [
"bold",
"italic",
"underline",
"h2",
"h3",
"numlist",
"bullist",
"removeformat",
"customLink",
"hr",
"code",
"fullscreen",
];
await knex("directus_fields")
.where({ id: hasContentField.id })
.update({
options: JSON.stringify({
...currentOptions,
toolbar: availableTools,
}),
});
}
}
export async function down(knex) {
// No need to revert the email message format change, so this is left empty.
}