DEV: Define form template field inputs (#20430)

This commit is contained in:
Keegan George
2023-03-01 11:07:13 -08:00
committed by GitHub
parent 8b67a534a0
commit 666b4a7e6b
37 changed files with 963 additions and 130 deletions
@@ -18,6 +18,14 @@ FormTemplate.reopenClass({
});
},
createOrUpdateTemplate(data) {
if (data.id) {
return this.updateTemplate(data.id, data);
} else {
return this.createTemplate(data);
}
},
deleteTemplate(id) {
return ajax(`/admin/customize/form-templates/${id}.json`, {
type: "DELETE",
@@ -35,4 +43,11 @@ FormTemplate.reopenClass({
return model.form_template;
});
},
validateTemplate(data) {
return ajax(`/admin/customize/form-templates/preview.json`, {
type: "GET",
data,
});
},
});