Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 1.06 KB

utilities_imageAlreadyInDbCheck.md

File metadata and controls

36 lines (21 loc) · 1.06 KB

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.

Defined in

src/utilities/imageAlreadyInDbCheck.ts:16