1
0
Fork 0
mirror of synced 2024-09-21 11:53:49 +12:00
budibase/packages/frontend-core/src/api/templates.js

36 lines
761 B
JavaScript
Raw Normal View History

export const buildTemplateEndpoints = API => ({
/**
* Gets the list of email template definitions.
*/
getEmailTemplateDefinitions: async () => {
return await API.get({ url: "/api/global/template/definitions" })
},
/**
* Gets the list of email templates.
*/
getEmailTemplates: async () => {
return await API.get({ url: "/api/global/template/email" })
},
/**
* Saves an email template.
* @param template the template to save
*/
saveEmailTemplate: async template => {
return await API.post({
url: "/api/global/template",
2022-01-25 21:04:56 +13:00
body: template,
})
},
/**
* Gets a list of app templates.
*/
getAppTemplates: async () => {
return await API.get({
url: "/api/templates",
})
},
})