/**
 * Made by mkcomponent.sh
 * * Change to Fileheader info *
*/

// Core imports
import { Component, OnInit } from '@angular/core'

// Services
import { UserProfileService } from '../../services/svc.userProfile'

@Component({
    moduleId: module.id+ '',
    selector: 'userProfile-orders',
    templateUrl: './template/t--orders.pug',
    styleUrls: ['sty.orders.scss']
})

export class OrdersComponent {

    // ---- Variables ---- \\
    orders: any
    displayOrder: any = ''
    constructor(
        private _userProfile: UserProfileService
    ) {

    }


    // ---- Lifecycle hooks ---- \\
    ngOnInit() {
        this._userProfile.getOrders().then((response) => {
            this.orders = response.data.userData.orders
            console.log(this.orders)
        })
    }


    // ---- Functions ---- \\
    displayThisOrder(id) {
        this.displayOrder = id
    }

}
