| 123456789101112131415161718192021 |
- async function existsUser(userCode){
- const response = await fetch("/api/existsUser", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- "X-App-Token": chatToken
- },
- body: JSON.stringify({
- user_code: userCode
- })
- });
- if (!response.ok) {
- const errorData = await response.json().catch(() => ({ message: "Respuesta no válida del servidor." }));
- throw new Error(errorData.message || `Error del servidor: ${response.status}`);
- }
- const data = await response.json();
- return data;
- }
- export { existsUser};
|