I am currently working on a create function and encountering some code that closely resembles this:
if(req.body.test !== undefined)
{
if(--req.body.test EXISTS IN test (model)--)
{
DO STUFF
}
else
{
DO OTHER STUFF
}
}
I have been trying to brainstorm a solution for quite some time now, but I am struggling to determine the code needed to handle the
--req.body.test EXISTS IN test (model)--
part. It seems more complicated than it actually is.
Any guidance or assistance would be greatly appreciated.
Thank you