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

import { Post } from '../../core/entities';
import { MyPostsService } from './my-posts.service';

@Component({
	selector: 'app-my-posts',
	templateUrl: './my-posts.component.html',
	styleUrls: ['./my-posts.component.scss']
})
export class MyPostsComponent implements OnInit {
	listPosts: Array<Post>;

	constructor(
		private myPostsService: MyPostsService
	) {}

	ngOnInit(): void {
		this.myPostsService.getMyPosts().subscribe(listPosts => {
			this.listPosts = listPosts;
		});
	}
}
