#58 change of member.roleProject

parent 1d73c96f
...@@ -82,7 +82,7 @@ const loadFixtures = async () => { ...@@ -82,7 +82,7 @@ const loadFixtures = async () => {
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
const newMember = new Member(); const newMember = new Member();
newMember.user = faker.helpers.arrayElement(users); newMember.user = faker.helpers.arrayElement(users);
newMember.role=faker.helpers.objectValue(MemberRole); newMember.roleProject=faker.helpers.objectValue(MemberRole);
await newMember.save(); await newMember.save();
members.push(newMember) members.push(newMember)
} }
......
...@@ -22,7 +22,7 @@ import { ...@@ -22,7 +22,7 @@ import {
user: User; user: User;
project: Project; project: Project;
createdAt: Date; createdAt: Date;
role: MemberRole; roleProject: MemberRole;
} }
...@@ -45,6 +45,6 @@ import { ...@@ -45,6 +45,6 @@ import {
enum: MemberRole, enum: MemberRole,
default: MemberRole.USER default: MemberRole.USER
}) })
role!: MemberRole roleProject!: MemberRole
} }
\ No newline at end of file
...@@ -41,7 +41,7 @@ router.post('/', async (req:Request, res:Response): Promise<Response> => { ...@@ -41,7 +41,7 @@ router.post('/', async (req:Request, res:Response): Promise<Response> => {
if(!user) return res.status(404).send({Message:'user not found'}) if(!user) return res.status(404).send({Message:'user not found'})
const member:Member = new Member; const member:Member = new Member;
member.user= user; member.user= user;
member.role= MemberRole.ADMIN; member.roleProject= MemberRole.ADMIN;
await member.save(); await member.save();
const project : Project= new Project() const project : Project= new Project()
project.title = title; project.title = title;
......
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