Skip to main content

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

NameTypeDescription
oldImagePathnull | stringPath of image
newImagePathstringDoes image belong to an item

Returns

Promise<string>

file name.

Defined in

src/utilities/imageAlreadyInDbCheck.ts:16