@tanglemedia/directus-collection-modal
Version:
Installs the Modal Collection to your Directus project.
41 lines (37 loc) • 1.07 kB
JavaScript
const MODAL_TABLE_NAME = "tngl_modal";
const translations = JSON.stringify([
{
plural: "Modals",
language: "en-US",
singular: "Modal",
translation: "Modal",
},
{
plural: "Modals",
language: "en-CA",
singular: "Modal",
translation: "Modal",
},
]);
export async function up(knex) {
// update directus_collection table to change tngl_modal table to be non singleton, with English translations, not hidden, and to have display template
await knex("directus_collections")
.where("collection", MODAL_TABLE_NAME)
.update({
singleton: 0,
translations: translations,
hidden: 0,
display_template: "{{heading}} - {{type}}",
});
}
export async function down(knex) {
// update directus_collection table to change tngl_modal table to be singleton, without translations, hidden, and without display template
await knex("directus_collections")
.where("collection", MODAL_TABLE_NAME)
.update({
singleton: 1,
translations: null,
hidden: 1,
display_template: null,
});
}