feat: Utilisation d'une clef API Docuseal par établissement

This commit is contained in:
N3WT DE COMPET
2025-05-30 14:19:01 +02:00
parent 8cf22905e5
commit 23ab7d04ef
21 changed files with 256 additions and 134 deletions

View File

@ -3,18 +3,19 @@ import { BE_DOCUSEAL_CLONE_TEMPLATE } from '@/utils/Url';
export default function handler(req, res) {
if (req.method === 'POST') {
const { templateId, email, is_required } = req.body;
const { templateId, email, is_required, establishment_id, apiDocuseal } = req.body;
fetch(BE_DOCUSEAL_CLONE_TEMPLATE, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Auth-Token': process.env.DOCUSEAL_API_KEY,
'X-Auth-Token': apiDocuseal,
},
body: JSON.stringify({
templateId,
email,
is_required,
establishment_id,
}),
})
.then((response) => {