feat: Création de clones lors de la création de RF [#22]

This commit is contained in:
N3WT DE COMPET
2025-03-01 17:50:54 +01:00
parent b97cf6e02b
commit d1a0067f7b
7 changed files with 145 additions and 64 deletions

View File

@ -1,6 +1,7 @@
import { BE_SUBSCRIPTION_REGISTRATIONFILE_GROUPS_URL,
BE_SUBSCRIPTION_REGISTRATION_TEMPLATES_URL,
BE_SUBSCRIPTION_REGISTRATION_TEMPLATE_MASTER_URL
BE_SUBSCRIPTION_REGISTRATION_TEMPLATE_MASTER_URL,
FE_API_DOCUSEAL_CLONE_URL
} from '@/utils/Url';
const requestResponseHandler = async (response) => {
@ -193,4 +194,18 @@ export const editRegistrationTemplateMaster = (fileId, data, csrfToken) => {
credentials: 'include',
})
.then(requestResponseHandler)
}
export const cloneTemplate = (templateId, email) => {
return fetch(`${FE_API_DOCUSEAL_CLONE_URL}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
templateId,
email
})
})
.then(requestResponseHandler)
}