import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import Parse from "parse";

@Component({
  selector: 'app-case-pet-detail',
  templateUrl: './case-pet-detail.page.html',
  styleUrls: ['./case-pet-detail.page.scss'],
})
export class CasePetDetailPage implements OnInit {

  constructor(private route:ActivatedRoute) { }

  ngOnInit() {
    this.loadPetById()
  }

  pet:Parse.Object|undefined
  async loadPetById(){
    // let id = location.pathname.split("/").pop();
    let id = this.route.snapshot.params["id"]

    if(id){
      let query = new Parse.Query("Pet");
      this.pet = await query.get(id);
    }
  }

}
