Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
21d8af09
Commit
21d8af09
authored
Nov 22, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#58
change of member.roleProject
parent
1d73c96f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
fixtures.ts
planner-api/src/fixtures.ts
+1
-1
Member.ts
planner-api/src/models/Member.ts
+2
-2
projects.ts
planner-api/src/routers/projects.ts
+1
-1
No files found.
planner-api/src/fixtures.ts
View file @
21d8af09
...
...
@@ -82,7 +82,7 @@ const loadFixtures = async () => {
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
newMember
=
new
Member
();
newMember
.
user
=
faker
.
helpers
.
arrayElement
(
users
);
newMember
.
role
=
faker
.
helpers
.
objectValue
(
MemberRole
);
newMember
.
role
Project
=
faker
.
helpers
.
objectValue
(
MemberRole
);
await
newMember
.
save
();
members
.
push
(
newMember
)
}
...
...
planner-api/src/models/Member.ts
View file @
21d8af09
...
...
@@ -22,7 +22,7 @@ import {
user
:
User
;
project
:
Project
;
createdAt
:
Date
;
role
:
MemberRole
;
role
Project
:
MemberRole
;
}
...
...
@@ -45,6 +45,6 @@ import {
enum
:
MemberRole
,
default
:
MemberRole
.
USER
})
role
!
:
MemberRole
role
Project
!
:
MemberRole
}
\ No newline at end of file
planner-api/src/routers/projects.ts
View file @
21d8af09
...
...
@@ -41,7 +41,7 @@ router.post('/', async (req:Request, res:Response): Promise<Response> => {
if
(
!
user
)
return
res
.
status
(
404
).
send
({
Message
:
'user not found'
})
const
member
:
Member
=
new
Member
;
member
.
user
=
user
;
member
.
role
=
MemberRole
.
ADMIN
;
member
.
role
Project
=
MemberRole
.
ADMIN
;
await
member
.
save
();
const
project
:
Project
=
new
Project
()
project
.
title
=
title
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment