@@ -8,14 +8,15 @@ import {
88 ITemplate ,
99 ICreateTemplate ,
1010 ITemplatesResponse ,
11- ICreateTemplateResponse ,
11+ IResponse ,
1212 UserChannelTypes ,
1313 ISendNotificationPayload ,
1414 IIntegration ,
1515 ISunshineConversationPageParameters ,
1616 ISunshineConversationGetIntegrationsFilters ,
1717 IMetadata ,
18- ISendNotificationResponse
18+ IMessageTemplate ,
19+ ISendNotification
1920} from "@models/index" ;
2021import { buildUrlParams } from "@utils/build-url-params" ;
2122import { INTERNATIONAL_PHONE_NUMBER_REGEX } from "@utils/regex" ;
@@ -176,13 +177,13 @@ export class SunshineConversationApiService {
176177 public async createWhatsAppTemplate (
177178 whatsAppIntegrationId : string ,
178179 createTemplateBody : ICreateTemplate
179- ) : Promise < ICreateTemplateResponse > {
180+ ) : Promise < IMessageTemplate > {
180181 const options = this . createV1Options (
181182 `/apps/${ this . settings . appId } /integrations/${ whatsAppIntegrationId } /messageTemplates` ,
182183 HttpMethod . POST ,
183184 createTemplateBody
184185 ) ;
185- return this . client . request ( options ) ;
186+ return ( await this . client . request < unknown , IResponse < IMessageTemplate > > ( options ) ) . responseJSON ;
186187 }
187188
188189 /**
@@ -234,7 +235,7 @@ export class SunshineConversationApiService {
234235 ...( metadata && { metadata } )
235236 } ;
236237
237- const { responseJSON } = await this . client . request < unknown , ISendNotificationResponse > (
238+ const { responseJSON } = await this . client . request < unknown , IResponse < ISendNotification > > (
238239 this . createV1Options ( `/apps/${ this . settings . appId } /notifications` , HttpMethod . POST , payload )
239240 ) ;
240241
0 commit comments