SupportVol / BackEnd

Unnecessary return await function found JS-0111
Performance
Major
5 months ago5 months old
Redundant use of await on a return value
 6 */
 7const getGroup = async (req, res) => {
 8  const { response, grpInstance } = req
 9  return await res.json({ response: await grpInstance.read() })10}
11
12/**
Redundant use of await on a return value
 8   * @returns {Promise} The promise that resolves with the result of the create operation.
 9   */
10  async create () {
11    return await this.fs.create(this.createStructure)12  }
13
14  /**
Redundant use of await on a return value
63   */
64  async update () {
65    const record = await this.read()
66    return await this.fs.update(67      updateData(68        [69          'name',70          'description',71          'organizations',72          'volunteers',73          'started_date',74          'expected_completing_date',75          'initiated_organization'76        ],77        [78          this.name,79          this.description,80          this.organizations,81          this.volunteers,82          this.started_date,83          this.expected_completing_date,84          this.initiated_organization85        ],86        record87      )88    )89  }
90}