Project 'angular/myAppraisal' was moved to 'angular/mySkill-x'. Please update any links and bookmarks that may still have the old path.
Commit c1b1b97c by DESKTOP-E0VCCBD\zedan

update

parent 9df7d108
......@@ -14,7 +14,8 @@ exports.createUser = async (req, res) => {
first_name: newUser.first_name,
last_name: newUser.last_name,
email: newUser.email,
role: newUser.role
role: newUser.role,
phone: newUser.phone
}
});
} catch (error) {
......
......@@ -9,6 +9,12 @@ const User = sequelize.define('User', {
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
profile_picture: {
type: DataTypes.STRING(500),
allowNull: true,
},
first_name: {
type: DataTypes.STRING(100),
allowNull: false,
......@@ -17,6 +23,10 @@ const User = sequelize.define('User', {
type: DataTypes.STRING(100),
allowNull: false,
},
phone: {
type: DataTypes.STRING(100),
allowNull: false,
},
email: {
type: DataTypes.STRING(255),
allowNull: false,
......
......@@ -11,51 +11,62 @@ import { EquipmentModel } from 'src/app/models/equipments.model';
export class ProductManagementComponent {
productList: EquipmentModel[] = []
selectedProduct?: EquipmentModel
constructor(private EquipmentService: EquipmentService) { }
selectedProduct?: EquipmentModel
constructor(private EquipmentService: EquipmentService) { }
ngOnInit() {
this.getUser()
}
ngOnInit() {
this.getProduct()
}
getUser() {
this.EquipmentService.getLists().subscribe(result => {
this.productList = result
})
}
getProduct() {
this.EquipmentService.getLists().subscribe(result => {
this.productList = result
})
}
getUserId() {
this.EquipmentService.getById("73079f3b-b58a-46e6-a779-20a64911e505").subscribe(result => {
getProductId() {
this.EquipmentService.getById("73079f3b-b58a-46e6-a779-20a64911e505").subscribe(result => {
console.log(result)
})
}
saveProduct() {
if (this.selectedProduct) {
this.EquipmentService.save(this.selectedProduct).subscribe(result => {
console.log(result)
})
}
}
saveUser() {
if (this.selectedProduct) {
this.EquipmentService.save(this.selectedProduct).subscribe(result => {
console.log(result)
})
}
}
deleteUser() {
if (this.selectedProduct) {
this.EquipmentService.delete(this.selectedProduct).subscribe(result => {
console.log(result)
})
}
updateProduct() {
if (this.selectedProduct) {
this.EquipmentService.update(this.selectedProduct).subscribe(result => {
console.log(result)
})
}
}
updateUser() {
if (this.selectedProduct) {
this.EquipmentService.update(this.selectedProduct).subscribe(result => {
console.log(result)
})
}
}
addToCart() {
addToCart(){
}
deleteProduct(product: EquipmentModel) {
this.selectedProduct = new EquipmentModel(product)
if (this.selectedProduct) {
this.EquipmentService.delete(this.selectedProduct).subscribe(result => {
console.log(result)
})
}
}
newproduct() {
this.selectedProduct = new EquipmentModel()
}
detailproduct(pj: EquipmentModel) {
this.selectedProduct = new EquipmentModel(pj)
}
}
......@@ -10,8 +10,7 @@ import { ProjectService } from 'src/app/services/project.service';
})
export class ProjectManagementComponent {
projectList:any[]=[];
projectList:ProJectModel[]=[];
selectedProject?: ProJectModel
constructor(private projectService: ProjectService) { }
......@@ -39,7 +38,8 @@ export class ProjectManagementComponent {
}
}
deleteProject() {
deleteProject(project:ProJectModel) {
this.selectedProject = new ProJectModel(project)
if (this.selectedProject) {
this.projectService.delete(this.selectedProject).subscribe(result => {
console.log(result)
......@@ -55,4 +55,13 @@ export class ProjectManagementComponent {
}
}
newPj() {
this.selectedProject = new ProJectModel()
}
detailPj(pj: ProJectModel) {
this.selectedProject = new ProJectModel(pj)
}
}
......@@ -3,6 +3,7 @@ import { BaseModel } from "./base.model";
export class EquipmentModel extends BaseModel {
equipment_id: string;
picture: string;
equipment_name: string;
description?: string;
quantity_total: number;
......@@ -13,6 +14,7 @@ export class EquipmentModel extends BaseModel {
constructor(data?: Partial<EquipmentModel>, translateService?: TranslateService) {
super(data, translateService);
this.picture=data?.picture??'';
this.equipment_id = data?.equipment_id ?? '';
this.equipment_name = data?.equipment_name ?? '';
this.description = data?.description ?? '';
......
import { TranslateService } from "@ngx-translate/core";
import { BaseModel } from "./base.model";
import { da } from "date-fns/locale";
export class ProJectModel extends BaseModel {
project_id: string;
picture: string;
project_name: string;
project_desc?: string;
start_date: string;
......@@ -12,6 +14,7 @@ export class ProJectModel extends BaseModel {
constructor(data?: Partial<ProJectModel>, translateService?: TranslateService) {
super(data, translateService);
this.picture = data?.picture??'';
this.project_id = data?.project_id ?? '';
this.project_name = data?.project_name ?? '';
this.project_desc = data?.project_desc ?? '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment