Skip to content

Commit

Permalink
chore(deleteFirebaseFile): update jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila committed Jan 9, 2024
1 parent f783926 commit c05d3b0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api/server/services/Files/Firebase/crud.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,12 @@ function extractFirebaseFilePath(urlString) {
}

/**
* Deletes a file from Firebase storage. This function determines the subfolder (either 'images' or 'documents')
* based on the file type and constructs a Firebase storage path using the user's ID and the file name.
* It then deletes the file from Firebase storage.
* Deletes a file from Firebase storage. This function determines the filepath from the
* Firebase storage URL via regex for deletion. Validated by the user's ID.
*
* @param {Object} req - The request object from Express. It should contain a `user` object with an `id` property.
* @param {Object} file - The file object to be deleted. It should have `filepath` and `type` properties.
* `filepath` is a string representing the file's name, and `type` is used to determine
* the file's storage subfolder in Firebase.
* @param {Express.Request} req - The request object from Express.
* It should contain a `user` object with an `id` property.
* @param {MongoFile} file - The file object to be deleted.
*
* @returns {Promise<void>}
* A promise that resolves when the file has been successfully deleted from Firebase storage.
Expand Down

0 comments on commit c05d3b0

Please sign in to comment.