Skip to content

Instantly share code, notes, and snippets.

@popeating
Created November 3, 2023 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popeating/5e3baa80268d227db2967f143e8d8725 to your computer and use it in GitHub Desktop.
Save popeating/5e3baa80268d227db2967f143e8d8725 to your computer and use it in GitHub Desktop.
export async function contactDelete(id) {
try {
const contact = await Contact.findByIdAndDelete(id, { new: true });
revalidatePath('/');
const newContact = { ...contact._doc, _id: contact._doc._id.toString() };
return newContact;
} catch (e) {
return { error: e.message };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment