mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 16:03:21 +00:00
chore: Application du linter
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import logger from '@/utils/logger';
|
||||
import { BE_DOCUSEAL_CLONE_TEMPLATE } from '@/utils/Url';
|
||||
|
||||
export default function handler(req, res) {
|
||||
@ -25,11 +26,11 @@ export default function handler(req, res) {
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
console.log('Template cloned successfully:', data);
|
||||
logger.debug('Template cloned successfully:', data);
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error cloning template:', error);
|
||||
logger.error('Error cloning template:', error);
|
||||
res.status(500).json({ error: 'Internal Server Error' });
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import logger from '@/utils/logger';
|
||||
import { BE_DOCUSEAL_DOWNLOAD_TEMPLATE } from '@/utils/Url';
|
||||
|
||||
export default function handler(req, res) {
|
||||
if (req.method === 'GET') {
|
||||
const { slug } = req.query;
|
||||
console.log('slug : ', slug);
|
||||
logger.debug('slug : ', slug);
|
||||
|
||||
fetch(`${BE_DOCUSEAL_DOWNLOAD_TEMPLATE}/${slug}`, {
|
||||
method: 'GET',
|
||||
@ -20,11 +21,11 @@ export default function handler(req, res) {
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
console.log('Template downloaded successfully:', data);
|
||||
logger.debug('Template downloaded successfully:', data);
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error downloading template:', error);
|
||||
logger.error('Error downloading template:', error);
|
||||
res.status(500).json({ error: 'Internal Server Error' });
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import logger from '@/utils/logger';
|
||||
import { BE_DOCUSEAL_GET_JWT } from '@/utils/Url';
|
||||
|
||||
export default function handler(req, res) {
|
||||
@ -11,17 +12,17 @@ export default function handler(req, res) {
|
||||
body: JSON.stringify(req.body),
|
||||
})
|
||||
.then((response) => {
|
||||
console.log('Response status:', response.status);
|
||||
logger.debug('Response status:', response.status);
|
||||
return response
|
||||
.json()
|
||||
.then((data) => ({ status: response.status, data }));
|
||||
})
|
||||
.then(({ status, data }) => {
|
||||
console.log('Response data:', data);
|
||||
logger.debug('Response data:', data);
|
||||
res.status(status).json(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
logger.error('Error:', error);
|
||||
res.status(500).json({ error: 'Internal Server Error' });
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import logger from '@/utils/logger';
|
||||
import { BE_DOCUSEAL_REMOVE_TEMPLATE } from '@/utils/Url';
|
||||
|
||||
export default function handler(req, res) {
|
||||
@ -19,11 +20,11 @@ export default function handler(req, res) {
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
console.log('Template removed successfully:', data);
|
||||
logger.debug('Template removed successfully:', data);
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error removing template:', error);
|
||||
logger.error('Error removing template:', error);
|
||||
res.status(500).json({ error: 'Internal Server Error' });
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user