summaryrefslogtreecommitdiff
path: root/src2/pages/api/register.js
blob: 7c8d8b390d4b938182009b8d0addc95d7d8e67ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import apiOdoo from "@/core/utils/apiOdoo";

export default async function handler(req, res) {
  try {
    const { email, name, password } = req.body;
    let result = await apiOdoo(
      'POST', 
      '/api/v1/user/register', 
      {email, name, password}
    );
    res.status(200).json(result);
  } catch (error) {
    res.status(400).json({ error: error.message });
  }
}