Created
November 3, 2023 13:03
-
-
Save popeating/5674e3d1d8f85649c8ab37edf9e527ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function contactAdd(data) { | |
try { | |
const contact = new Contact(data); | |
contact.save(); | |
const newContact = { ...contact._doc, _id: contact._doc._id.toString() }; | |
revalidatePath('/'); | |
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