title: Property 'id' does not exist on type 'void'
body: <p>Im trying to implement an audit trail for all actions for my angular application, like 'delete' 'addUser' 'update' etc. i was able to implement this successfully with the 'post blog' function which is in the "posts-dashboard.component.ts" and now im trying to do the same with the 'delete user' function which is in the "student-user.component.ts" but the compiler returns an error "Property 'id' does not exist on type 'void'"</p>
  
  <p>i've tried defining id as 'id: any;' and 'id =''' but i don't think that's the solution. the error wont go away. The audit trail function  is supposed to print the output (audit trail) in the console and store the audit trail log in the database under the audit-trail model</p>
  
  <p>this is my student-user.component.ts. Look out for the deleteStudent(value) function...that's where i'm implementimg it</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { map, catchError} from 'rxjs/operators';
  import {FirebaseService} from '../services/firebase.service';
  import {Router} from '@angular/router';
  import { AngularFirestore} from "angularfire2/firestore";
  import { Observable } from 'rxjs';
  import { AuditTrailService } from 'src/app/services/audit-trail/audit-trail.service';
  import { AngularFireStorage } from '@angular/fire/storage';
  
  
  @Component({
    selector: 'app-student-user',
    templateUrl: './student-user.component.html',
    styleUrls: ['./student-user.component.scss']
  })
  
  export class StudentUserComponent implements OnInit{
    students: any;
    students_data :any;
    public searchString: string;
    response: any;
    is_loading: any;
    ideas; any;
    term = '';
    //id: any[];
  
  
    constructor(
      public firebaseService: FirebaseService,
      private router: Router,
      public db: AngularFirestore,
      private storage: AngularFireStorage,
      public _auditTrailService:AuditTrailService
    ) { }
  
  
   ngOnInit() {
  
    this.getStudents()
    this.searchStudents(event)
  
  }
  
  
  getStudents() {
    this.students_data = this.db.collection('User', ref =&gt; ref.where('role', '==', 'student')).snapshotChanges().pipe(map(changes =&gt; {
  
    return changes.map(a =&gt; {
    const data: any = a.payload.doc.data();
    data.id = a.payload.doc.id;
    return data;
    });
    })
    );
  
    this.students_data.subscribe(
    res =&gt; {
    console.log(res);
    this.students = res;
    //this.blogs_snapshot = res;
    });
  
    }
  
    searchStudents(event){
      if (event.key === "Enter"){
        console.log(this.term)
        this.db.collection('User', ref =&gt; ref.where('full_name', '==', this.term)).valueChanges().subscribe(
        res =&gt; {
        this.response = res;
        console.log(this.response);
  
        this.ideas = res;
        this.is_loading = false;
          }
          );
      }
    }
  
    deleteStudent(value){
      this.db.collection('User').doc(value).delete().then( 
        res =&gt;{
        console.log(res)
        this.students = res;
        const _audit_trail = {
          'action' : ' has deleted a student ',
          'object': res.id,
          'created_at': new Date(),
          'user':{
            'id': '4545454545454545454',
            'email':'daanyu@gmail.com' }
           } 
        console.log(_audit_trail)
  
        this._auditTrailService.createAuditTrailLog(_audit_trail)
  
      },
  
      err=&gt;{
        console.log(err)
      }
      )
    }
  
  } 
  
  </code></pre>
  
  <p>this is my error ...</p>
  
  <pre><code>ERROR in src/app/student-user/student-user.component.ts(87,23): error TS2339: Property 'id' does not exist on type 'void'.
  </code></pre>
  
  <p>Im using Firebase as my Database and this is what i expect returned in the db under my audit-trail model: </p>
  
  <p>action " has deleted a student"
  created_at July 22, 2019 at 5:49:33 PM UTC+3
  user:
  email "daanyu@gmail.com"
  id "4545454545454545454"</p>