MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / checkUserExist

Function checkUserExist

apps/OpenSign/src/primitives/AddContact.jsx:41–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }, [addYourself]);
40
41 const checkUserExist = async () => {
42 try {
43 const baseURL = localStorage.getItem("baseUrl");
44 const url = `${baseURL}functions/isuserincontactbook`;
45 const token =
46 { "X-Parse-Session-Token": localStorage.getItem("accesstoken") };
47 const headers = {
48 "Content-Type": "application/json",
49 "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
50 ...token
51 };
52 const axiosRes = await axios.post(url, {}, { headers });
53 const contactRes = axiosRes?.data?.result || {};
54 if (!contactRes?.objectId) {
55 setIsUserExist(true);
56 }
57 } catch (err) {
58 console.log("err ", err);
59 }
60 };
61 // Define a function to handle form submission
62 const handleSubmit = async (e) => {
63 e.preventDefault();

Callers 1

AddContactFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected