From f93f27877f48ff7852fdebb0ea3af01463cbc5be Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 10 Dec 2024 13:03:43 +0000 Subject: [PATCH] Update template endpoints --- packages/frontend-core/src/api/templates.ts | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/frontend-core/src/api/templates.ts b/packages/frontend-core/src/api/templates.ts index 6c742840c1..12c5606b8b 100644 --- a/packages/frontend-core/src/api/templates.ts +++ b/packages/frontend-core/src/api/templates.ts @@ -1,13 +1,20 @@ -import { FetchTemplateResponse, Template } from "@budibase/types" +import { + FetchGlobalTemplateByTypeResponse, + FetchGlobalTemplateDefinitionResponse, + FetchTemplateResponse, + SaveGlobalTemplateRequest, + SaveGlobalTemplateResponse, + Template, +} from "@budibase/types" import { BaseAPIClient } from "./types" export interface TemplateEndpoints { - getEmailTemplates: () => Promise + getEmailTemplates: () => Promise getAppTemplates: () => Promise - - // Missing request or response types - getEmailTemplateDefinitions: () => Promise - saveEmailTemplate: (templaet: any) => Promise + getEmailTemplateDefinitions: () => Promise + saveEmailTemplate: ( + template: SaveGlobalTemplateRequest + ) => Promise } export const buildTemplateEndpoints = ( @@ -24,10 +31,9 @@ export const buildTemplateEndpoints = ( * Gets the list of email templates. */ getEmailTemplates: async () => { - const res = await API.get