import { Component } from '@angular/core';
import { User } from '../user/user.entity'
import { Answer } from '../topics/answer.entity'
import { Router, ActivatedRoute } from '@angular/router';
import { LoginService } from "../login/login.service";
import { Activity } from './activity.entity'
import { ActivityService } from './activity.service'


@Component({
    selector: 'activityAdd',
    templateUrl: './activityAdd.component.html'
})
export class ActivityAddComponent {
    contentN: string;
    nameActivityN: string;
    activityTypeN: string='WATCHEDMOVIE';
    
    formData: Activity = {
        content: '',
        nameactivity: '',
        activityType: ''
    }

    constructor(private activatedRoute: ActivatedRoute, private router: Router, private loginService: LoginService, private activityService: ActivityService) {
    }

    addNewActivity() 






}

{
        this.formData.content = this.contentN;
        this.formData.nameactivity = this.nameActivityN;
        this.formData.activityType = this.activityTypeN;
        this.activityService.addActivity(this.formData).subscribe(
            response =>
                this.router.navigate(['/activity'])
        );

    }