TSlint阴影名称:“响应”(无阴影变量)

时间:2019-06-18 18:25:02

标签: node.js typescript web-component tslint

运行TSlint时出现以下错误。

错误:带阴影的名称:“响应”(无阴影变量)

在代码下面,也许您可​​以帮助修复它?

async dialogCreate(event: Event) {
        const newAdmin: Admin = (event as any).detail;
        newAdmin.clientId = this.account[0].clientId;
        const response = httpClientUser.post('createUser', newAdmin)
        .then(response => response.json())
        .then(data => {
            this.admins = [...this.admins, data]
          })
          .catch(err => {
            // Do something for an error here TODO
          });
        this.resetValues();
    }

    async dialogSave(event: Event) {
        const updatedadmin: Admin = (event as any).detail;
        const response = httpClientUser.post('updateUser', updatedadmin)
        .then(response => response.json())
        .then(data => {
            const indexOfAdmin = this.getIndexOfAdmin(data.id);
            this.admins[indexOfAdmin] = data;
            this.admins = this.admins.slice(0);
        })
        .catch(err => {
          // Do something for an error here TODO
        });
        this.resetValues();
    }

0 个答案:

没有答案