Skip to content

Commit

Permalink
Add migration to update "Acknowledgments" field in "Menu" model to us…
Browse files Browse the repository at this point in the history
…e markdown editor
  • Loading branch information
sjoerdbeentjes committed Dec 10, 2024
1 parent 3e1f869 commit ea05fe9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions migrations/1733825239_colophonPresentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Client } from "@datocms/cli/lib/cma-client-node";

export default async function (client: Client) {
console.log("Update existing fields/fieldsets");

const currentField = await client.fields.find("H7cTIWERTG-z24IE8ILCUw");

console.log(
'Update Multiple-paragraph text field "Acknowledgments" (`acknowledgments`) in model "Menu" (`menu`)'
);
await client.fields.update("H7cTIWERTG-z24IE8ILCUw", {
appearance: {
addons: currentField.appearance.addons,
editor: "markdown",
parameters: {
toolbar: [
"heading",
"bold",
"italic",
"strikethrough",
"code",
"unordered_list",
"ordered_list",
"quote",
"link",
"image",
"fullscreen",
],
},
type: "markdown",
},
});
}

0 comments on commit ea05fe9

Please sign in to comment.