dsg
INSERT INTO `cp_filejs` (`id`,`app`,`path`,`modul`,`file_name`,`content`) VALUES ('194','2','u6/driver','','js/api/scanner.js-','import {\r\n getSessionUser\r\n} from \\\"./auth.js\\\"\r\nimport {\r\n API_URL\r\n} from \\\"./consts.js\\\"\r\n\r\nexport const verifyScan = async (decodedText) => {\r\n const user = await getSessionUser()\r\n\r\n const response = await fetch(`${API_URL}/wp-json/app/v1/verify-qr-code`, {\r\n method: \\\"POST\\\",\r\n headers: {\r\n \\\"Content-Type\\\": \\\"application/json\\\",\r\n },\r\n body: JSON.stringify({\r\n user_id: user?.id,\r\n qr_code: decodedText\r\n }),\r\n })\r\n\r\n const data = await response.json()\r\n return data\r\n}\r\n\r\nconst linkProfile = async (decodedText) => {\r\n const user = await getSessionUser()\r\n\r\n const response = await fetch(`${API_URL}/wp-json/app/v1/link-qr-code-entity`, {\r\n cache: \\\"no-cache\\\",\r\n method: \\\"POST\\\",\r\n headers: {\r\n \\\"Content-Type\\\": \\\"application/json\\\",\r\n },\r\n body: JSON.stringify({\r\n entity_id: user?.id,\r\n qr_code: decodedText,\r\n entity_type: \\\"profile\\\"\r\n }),\r\n })\r\n\r\n const data = await response.json()\r\n return data\r\n}\r\n\r\nconst unlinkProfile = async (decodedText) => {\r\n const user = await getSessionUser()\r\n\r\n const response = await fetch(`${API_URL}/wp-json/app/v1/unlink-qr-code-entity`, {\r\n cache: \\\"no-cache\\\",\r\n method: \\\"POST\\\",\r\n headers: {\r\n \\\"Content-Type\\\": \\\"application/json\\\",\r\n },\r\n body: JSON.stringify({\r\n qr_code: decodedText,\r\n entity_id: user?.id,\r\n entity_type: \\\"profile\\\"\r\n }),\r\n })\r\n\r\n const data = await response.json()\r\n return data\r\n}\r\n\r\nexport const getIDFromQrCode = async (decodedText) => {\r\n const response = await fetch(`${API_URL}/wp-json/app/v1/get-linked-entity`, {\r\n cache: \\\"no-cache\\\",\r\n method: \\\"POST\\\",\r\n headers: {\r\n \\\"Content-Type\\\": \\\"application/json\\\",\r\n },\r\n body: JSON.stringify({\r\n qr_code: decodedText\r\n }),\r\n })\r\n\r\n const data = await response.json()\r\n\r\n if ((data && data.error) || response.status === 404) {\r\n throw new Error(data.error)\r\n }\r\n\r\n return data\r\n}\r\n\r\nexport const handleLink = async (result) => {\r\n if (!result) {\r\n return\r\n }\r\n\r\n try {\r\n const response = await linkProfile(result?.qr_code)\r\n return response\r\n } catch (e) {\r\n console.error(\\\"Error linking profile\\\", e)\r\n return {\r\n status: \\\\\\\'error\\\\\\\',\r\n text: \\\\\\\'Error linking profile\\\\\\\'\r\n }\r\n }\r\n}\r\n\r\nexport const handleUnlink = async (result) => {\r\n if (!result) {\r\n return\r\n }\r\n\r\n try {\r\n const response = await unlinkProfile(result?.qr_code)\r\n\r\n if (response.status === \\\\\\\'error\\\\\\\') {\r\n return {\r\n type: \\\\\\\'error\\\\\\\',\r\n text: response.message\r\n }\r\n } else {\r\n return {\r\n type: \\\\\\\'success\\\\\\\',\r\n text: response.message\r\n }\r\n }\r\n\r\n } catch (e) {\r\n console.error(\\\"Error unlinking profile\\\", e)\r\n return {\r\n type: \\\\\\\'error\\\\\\\',\r\n text: \\\\\\\'Error unlinking profile\\\\\\\'\r\n }\r\n }\r\n}');

Fatal error: Uncaught mysqli_sql_exception: Duplicate entry '194' for key 'PRIMARY' in /home/u340524018/domains/agniaga.com/public_html/sub/u2/cp/common.function.php:186 Stack trace: #0 /home/u340524018/domains/agniaga.com/public_html/sub/u2/cp/common.function.php(186): mysqli_query() #1 /home/u340524018/domains/agniaga.com/public_html/sub/u2/cp/inc.filejs.php(86): Insert() #2 /home/u340524018/domains/agniaga.com/public_html/sub/u2/cp/index.php(286): include('/home/u34052401...') #3 {main} thrown in /home/u340524018/domains/agniaga.com/public_html/sub/u2/cp/common.function.php on line 186