talawa-api / Exports / utilities/imageAlreadyInDbCheck
Module: utilities/imageAlreadyInDbCheck
Table of contents
Functions
Functions
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.
Parameters
Name | Type | Description |
---|---|---|
oldImagePath | null | string | Path of image |
newImagePath | string | Does image belong to an item |
Returns
Promise
<string
>
file name.