11import type { DeferredJobsApiClient } from '../../api' ;
22import { routing } from '../../routing' ;
3- import type { Template } from '../../types' ;
3+ import type { ExtendedTemplate , Template } from '../../types' ;
44
55import type { CreateRequest , UpdateRequest } from './types' ;
66
@@ -15,23 +15,23 @@ export function createClient(api: DeferredJobsApiClient) {
1515 return templates ;
1616 }
1717
18- async function get ( templateId : TemplateId ) : Promise < Template > {
18+ async function get ( templateId : TemplateId ) : Promise < ExtendedTemplate > {
1919 const url = routing . templatesUrl ;
20- const { template } = await api . get < { template : Template } > ( `${ url } /${ templateId } ` ) ;
20+ const { template } = await api . get < { template : ExtendedTemplate } > ( `${ url } /${ templateId } ` ) ;
2121 return template ;
2222 }
2323
24- async function create ( payload : CreateRequest ) : Promise < Template > {
24+ async function create ( payload : CreateRequest ) : Promise < ExtendedTemplate > {
2525 const url = routing . templatesUrl ;
26- const { template } = await api . post < { template : Template } > ( url , {
26+ const { template } = await api . post < { template : ExtendedTemplate } > ( url , {
2727 payload,
2828 } ) ;
2929 return template ;
3030 }
3131
32- async function update ( templateId : TemplateId , payload : UpdateRequest ) : Promise < Template > {
32+ async function update ( templateId : TemplateId , payload : UpdateRequest ) : Promise < ExtendedTemplate > {
3333 const url = routing . templatesUrl ;
34- const { template } = await api . patch < { template : Template } > ( `${ url } /${ templateId } ` , {
34+ const { template } = await api . patch < { template : ExtendedTemplate } > ( `${ url } /${ templateId } ` , {
3535 payload,
3636 } ) ;
3737 return template ;
0 commit comments