Entfernen: Debug-Instrumentierung (localhost:7243) aus Contact und Appwrite
This commit is contained in:
1 parent
e3269518bd
commit
8fa7c2c078
2 files changed
+11
-38
No files matched your search
+11
-27
@@ -37,31 +37,15 @@ export type ContactFormData = {
|
||||
|
||||
export async function createContactDocument(data: ContactFormData) {
|
||||
if (!_databases) _databases = getDatabases();
|
||||
const docId = ID.unique();
|
||||
// #region agent log
|
||||
fetch('http://localhost:7243/ingest/8d1383cf-9102-464e-a10c-b6b8ee60ecff',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'appwrite.ts:createContactDocument',message:'before createDocument',data:{docId},timestamp:Date.now(),hypothesisId:'C'})}).catch(()=>{});
|
||||
// #endregion
|
||||
try {
|
||||
const result = await _databases.createDocument<ContactFormData>(
|
||||
CONTACT_DATABASE_ID,
|
||||
CONTACT_COLLECTION_ID,
|
||||
docId,
|
||||
{
|
||||
name: data.name,
|
||||
email: data.email,
|
||||
company: data.company,
|
||||
message: data.message,
|
||||
}
|
||||
);
|
||||
// #region agent log
|
||||
fetch('http://localhost:7243/ingest/8d1383cf-9102-464e-a10c-b6b8ee60ecff',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'appwrite.ts:createContactDocument',message:'createDocument resolved',data:{},timestamp:Date.now(),hypothesisId:'A'})}).catch(()=>{});
|
||||
// #endregion
|
||||
return result;
|
||||
} catch (e) {
|
||||
// #region agent log
|
||||
const errObj = e instanceof Error ? { message: e.message, stack: e.stack, name: e.name } : { message: String(e) };
|
||||
fetch('http://localhost:7243/ingest/8d1383cf-9102-464e-a10c-b6b8ee60ecff',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'appwrite.ts:createContactDocument catch',message:'createDocument rejected',data:errObj,timestamp:Date.now(),hypothesisId:'A,B,C,D,E'})}).catch(()=>{});
|
||||
// #endregion
|
||||
throw e;
|
||||
}
|
||||
return _databases.createDocument<ContactFormData>(
|
||||
CONTACT_DATABASE_ID,
|
||||
CONTACT_COLLECTION_ID,
|
||||
ID.unique(),
|
||||
{
|
||||
name: data.name,
|
||||
email: data.email,
|
||||
company: data.company,
|
||||
message: data.message,
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user