SupportVol / BackEnd

Class methods should utilize this JS-0105
Anti-pattern
Minor
5 months ago5 months old
Expected 'this' to be used by class async method 'deleteFile'
67   * @param {string} path - The path of the file to delete.
68   * @returns {Promise<[boolean, string | Error]>} A promise containing deletion status and download URL (if successful).
69   */
70  async deleteFile (path) {71    try {
72      const storageRef = ref(storage, path)
73      await deleteObject(storageRef)
Expected 'this' to be used by class async method 'getDownloadURL'
51   * @param {string} path - The path of the file.
52   * @returns {Promise<[boolean, string | Error]>} A promise containing retrieval status and download URL (if successful).
53   */
54  async getDownloadURL (path) {55    try {
56      const storageRef = ref(storage, path)
57      const downloadURL = await getDownloadURL(storageRef)
Expected 'this' to be used by class async method 'uploadFile'
34   * @param {string} path - The path to store the file.
35   * @returns {Promise<[boolean, string | Error]>} A promise containing upload status and download URL (if successful).
36   */
37  async uploadFile (file, path) {38    try {
39      const storageRef = ref(storage, path)
40      const snapshot = await storageRef.put(file)
Expected 'this' to be used by class async method 'getUsers'
101    return request
102  }
103
104  async getUsers () {105    const listUsersResult = await auth.listUsers()
106    const users = await Promise.all(
107      listUsersResult.users.map(async (userRecord) => {
Expected 'this' to be used by class async method 'resetPassword'
 96    return userCreds
 97  }
 98
 99  async resetPassword (email) {100    const request = await auth.sendPasswordResetEmail(email)
101    return request
102  }