diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-20 16:52:16 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-20 16:52:16 +0700 |
| commit | a784f4623448ff846dbc5c8259405e6cce8fffb7 (patch) | |
| tree | 016da331ea5a18ef2c3c1264728b1199b5e9172a /src/pages/api/activation-request.js | |
| parent | 1db54e16f970b4e09df89d432efd5a66ac775eb6 (diff) | |
| parent | b7e7696d675d0c2e36364f7cbedb0483a343048d (diff) | |
Merge branch 'release' into Feature/new-register
Diffstat (limited to 'src/pages/api/activation-request.js')
| -rw-r--r-- | src/pages/api/activation-request.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/pages/api/activation-request.js b/src/pages/api/activation-request.js index 64a67bbc..2b8ccec3 100644 --- a/src/pages/api/activation-request.js +++ b/src/pages/api/activation-request.js @@ -1,10 +1,12 @@ -import odooApi from '@/core/api/odooApi' -import mailer from '@/core/utils/mailer' +import odooApi from '@/core/api/odooApi'; +import mailer from '@/core/utils/mailer'; export default async function handler(req, res) { try { - const { email } = req.body - let result = await odooApi('POST', '/api/v1/user/activation-request', { email }) + const { email } = req.body; + let result = await odooApi('POST', '/api/v1/user/activation-request', { + email, + }); if (result.activationRequest) { mailer.sendMail({ from: 'noreply@indoteknik.com', @@ -14,14 +16,14 @@ export default async function handler(req, res) { <h1>Permintaan Aktivasi Akun Indoteknik</h1> <br> <p>Aktivasi akun anda melalui link berikut: <a href="${process.env.NEXT_PUBLIC_SELF_HOST}/activate?token=${result.token}">Aktivasi Akun</a></p> - ` - }) + `, + }); } - delete result.user - delete result.token - res.status(200).json(result) + delete result.user; + delete result.token; + res.status(200).json(result); } catch (error) { - console.log(error) - res.status(400).json({ error: error.message }) + console.log(error); + res.status(400).json({ error: error.message }); } } |
