talawa-api / Exports / utilities/imageAlreadyInDbCheck
▸ imageAlreadyInDbCheck(oldImagePath
, newImagePath
): Promise
<string
>
This function checks if an image already exists in the database using hash. If it does, then point to that image and remove the image just uploaded. Else, allow the file to get uploaded.
Name | Type | Description |
---|---|---|
oldImagePath |
null | string |
Path of image |
newImagePath |
string |
Does image belong to an item |
Promise
<string
>
file name.