优化这段代码：
async getTaskIdList() {
      this.$store.dispatch("showLoading");
      const idresList = await Promise.all(
        this.taskList.map((t) => {
          return this.$teacherDevelopRequest(
            `/tpd/competency_tasks/${t.name}`,
            {
              method: "get",
              params: {
                parent_id: 4,
              },
            }
          );
        })
      );
      this.$store.dispatch("hideLoading");
      idresList.forEach((t) => {
        if (t.errcode === 1) {
          if (t.result) {
            t.result.forEach((item) => {
              if (item.id == 4) {
                item.id = 19;
              }
            });
          }
          this.taskIdList.push(...t.result);
        }
      });
      console.log(this.taskIdList, "this.taskIdList");
    }, Provide response in all capital letters, no lowercase letters allowed.
user