Connection Closed Error when deleting a record from xata
Unanswered
Asian black bear posted this in #help-forum
Asian black bearOP
Hi, I am getting the following error:
⨯ Error: Connection closed.
at e.exports.emit (node:events:526:35)
This error is coming from this handler:
const handleDelete = async (data1) => {
'use server'
console.log("hi")
// "use server";
// const xata = getXataClient();
// const itemId = data1.get("itemId");
// const record = await xata.db["coin-data"].delete(itemId);
// console.log(record);
// redirect('/dashboard')
};
This form submission calls the handler:
<form onSubmit={handleDelete}>
<input name="itemId" type='hidden' value={name.id} />
<button className="delete_a" type="submit">X</button>
</form>
I am not sure whats causing the error, the app was working fine until it suddenly started to throw this error. Any help would be greatly appreciated thanks.
⨯ Error: Connection closed.
at e.exports.emit (node:events:526:35)
This error is coming from this handler:
const handleDelete = async (data1) => {
'use server'
console.log("hi")
// "use server";
// const xata = getXataClient();
// const itemId = data1.get("itemId");
// const record = await xata.db["coin-data"].delete(itemId);
// console.log(record);
// redirect('/dashboard')
};
This form submission calls the handler:
<form onSubmit={handleDelete}>
<input name="itemId" type='hidden' value={name.id} />
<button className="delete_a" type="submit">X</button>
</form>
I am not sure whats causing the error, the app was working fine until it suddenly started to throw this error. Any help would be greatly appreciated thanks.