mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
feat: Ajout d'un nouveau status avec envoi de mandat SEPA + envoi de
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import ToggleSwitch from '@/components/ToggleSwitch'; // Import du composant ToggleSwitch
|
||||
import { fetchRegistrationFileGroups, createRegistrationTemplates, cloneTemplate } from '@/app/actions/registerFileGroupAction';
|
||||
import { fetchRegistrationFileGroups, createRegistrationTemplates, cloneTemplate, generateToken } from '@/app/actions/registerFileGroupAction';
|
||||
import { DocusealBuilder } from '@docuseal/react';
|
||||
import logger from '@/utils/logger';
|
||||
import { BE_DOCUSEAL_GET_JWT, BASE_URL } from '@/utils/Url';
|
||||
import { BE_DOCUSEAL_GET_JWT, BASE_URL, FE_API_DOCUSEAL_GENERATE_TOKEN } from '@/utils/Url';
|
||||
import Button from '@/components/Button'; // Import du composant Button
|
||||
import MultiSelect from '@/components/MultiSelect'; // Import du composant MultiSelect
|
||||
import { useCsrfToken } from '@/context/CsrfContext';
|
||||
@ -33,27 +33,14 @@ export default function FileUpload({ handleCreateTemplateMaster, handleEditTempl
|
||||
}, [fileToEdit]);
|
||||
|
||||
useEffect(() => {
|
||||
const body = fileToEdit
|
||||
? JSON.stringify({
|
||||
user_email: 'n3wt.school@gmail.com',
|
||||
id: fileToEdit.id
|
||||
})
|
||||
: JSON.stringify({
|
||||
user_email: 'n3wt.school@gmail.com'
|
||||
});
|
||||
|
||||
fetch('/api/docuseal/generateToken', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: body,
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
setToken(data.token);
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
const email = 'n3wt.school@gmail.com';
|
||||
const id = fileToEdit ? fileToEdit.id : null;
|
||||
|
||||
generateToken(email, id)
|
||||
.then((data) => {
|
||||
setToken(data.token);
|
||||
})
|
||||
.catch((error) => console.error('Erreur lors de la génération du token:', error));
|
||||
}, [fileToEdit]);
|
||||
|
||||
const handleFileNameChange = (event) => {
|
||||
|
||||
Reference in New Issue
Block a user