diff --git a/client/src/pages/Designers/index.jsx b/client/src/pages/Designers/index.jsx
index 981e0a2..b698b13 100644
--- a/client/src/pages/Designers/index.jsx
+++ b/client/src/pages/Designers/index.jsx
@@ -1,11 +1,149 @@
-import React from 'react'
-
+import React from "react";
+import toast from "react-hot-toast";
+import axios from "axios";
const Designer_home = () => {
- return (
-
-
-
-
-
Customise Now
-
Form is mobile responsive. Give it a try.
-
-
-
-
-
Personal Details
-
Please fill out all the fields.
-
-
-
+ return (
+
+
-
-
-
-
-
- )
-}
+ );
+};
-export default Retailer_home
\ No newline at end of file
+export default Retailer_home;
diff --git a/server/controllers/user.js b/server/controllers/user.js
index b6945ea..4be992e 100644
--- a/server/controllers/user.js
+++ b/server/controllers/user.js
@@ -65,13 +65,24 @@ const getMyProfile = (req, res) => {
const registerdesigner = (req, res) => {
const { description, portfoliolink } = req.body;
- con.query(`INSERT INTO designer VALUES ('${req.user["email"]}', '${description}', '${portfoliolink}')`, (err, result) => {
+ con.query(`SELECT * FROM designer WHERE email='${req.user["email"]}'`, (err, result) => {
if (err) {
throw err;
}
- return res.status(200).json({
- success: true,
- message: "Registered Designer"
+ if (result.length != 0) {
+ return res.status(404).json({
+ success: false,
+ message: "Designer already exists."
+ });
+ }
+ con.query(`INSERT INTO designer VALUES ('${req.user["email"]}', '${description}', '${portfoliolink}')`, (err, result) => {
+ if (err) {
+ throw err;
+ }
+ return res.status(200).json({
+ success: true,
+ message: "Registered Designer"
+ });
})
})
}