如何在回邮中使用特定回复

我在服务器上发了一个帖子,可以返回res {成功:true}

enter image description here

在我的帖子中,如果收到此回复,则表示我正在努力

this.successPost = true;

this.invitePost = false;

仅对这种确切的回应。 res {成功:正确}

我的ts代码始终在任何res响应上返回if,而永不返回else。

ts

async sendInvite() {
  let formData = {
    "firstName" : this.data.firstName,
    "lastName" : this.data.lastName,
    "email" : this.data.email
  };
  this.httpClient.post<any>('https://8618' + formData, { 
    headers: { 'x-authorization-token': 'XXXXXXXXXX' }}   
    )
    .pipe(
      finalize(() => { })
    ).subscribe(
        res => {
          console.log ("res", res);
          let response = JSON.stringify(res);
            console.log ("response", response);
            if (res = {success: true} ) {
                this.presentToast(response);
                this.successPost = true;
                this.invitePost = false;
              } else {
                this.presentToast(response);
              }
        },
        (err: HttpErrorResponse) => {  // fire on offline
          console.log("err.error", err.error);
          this.presentToast(err.error);
        }  
  );
}