Skip to content

integrate emplyee with backend#118

Open
Nada257 wants to merge 8 commits intomainfrom
#116-integrate-emplyee-data-with-backend
Open

integrate emplyee with backend#118
Nada257 wants to merge 8 commits intomainfrom
#116-integrate-emplyee-data-with-backend

Conversation

@Nada257
Copy link
Copy Markdown

@Nada257 Nada257 commented Nov 2, 2022

No description provided.

export interface Emplyee{
id:number;
name:string;
description:string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make name of file start by small character.

employee doesn't have description it have company --> get it from swagger.

})
export class MessageService {
delete(id: number) {
throw new Error('Method not implemented.');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you made this function?


constructor(
private formBuilder: FormBuilder,
private _EmployeeRepository: EmployeeRepository,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name must be camel case.

companyId:['', [Validators.required]]
}
addEmployee(){
this._EmployeeRepository.update(this.employeeForm.value).subscribe(()=>{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function add not update

.subscribe((result) => {
this.allEmployees = result.data;
this.totalItems = result.pagination.itemCount;
console.log(result)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete console.

})
})
}
onSubmit() {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete unneeded function.

this.isVisible = !this.isVisible;
}
appearRest() {
this.isRestButtonAppear = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you need this function?

<mat-option value="over">Over</mat-option>
<mat-option value="push">Push</mat-option>
<mat-option value="Education">Education</mat-option>
<mat-option value="Government">Government</mat-option>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use endpoint of company(get it from swagger) to show data in dropdown list
don't make it static

image

export interface emplyee{
id:number;
name:string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from swagger you can get the object of employee property
where property of company?

image

totalItems: number = 0;

constructor(private formBuilder: FormBuilder, private companyRepository: CompanyRepository,private message: MessageService) { }
constructor(private FormBuilder: FormBuilder, private companyRepository: CompanyRepository,private message: MessageService) { }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make FormBuilder ---> camel case

size: number = 10;
totalItems: number = 0;
allEmployees: emplyee[] = [];
isRestButtonAppear: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete un need property

this.employeeForm = this.formBuilder.group({
id: [''],
name: ['', [Validators.required]],
companyId: ['', [Validators.required]],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be same of interface company not companyId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants