Merge branch 'julius-dev' of Software_Engineering_I/greenvironment-server into master

pull/5/head
Trivernis 5 years ago committed by Gitea
commit 0d562e0f88

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Mocha Tests - Mocha Tests
- worker initialization error handling - worker initialization error handling
- bearer token authentification for testing purposes - bearer token authentification for testing purposes
- Added `deletable' field on post
### Removed ### Removed
@ -33,10 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- graphql schema for denyRequest using the wrong parameters - graphql schema for denyRequest using the wrong parameters
- sendRequest allowing duplicates - sendRequest allowing duplicates
### Added
- Added `deleteable' field on post
## [0.9] - 2019-10-29 ## [0.9] - 2019-10-29

@ -286,7 +286,7 @@ type Post {
userVote(userId: ID!): VoteType userVote(userId: ID!): VoteType
"if the post can be deleted by the specified user" "if the post can be deleted by the specified user"
deleteable(userId: ID!): Boolean deletable(userId: ID!): Boolean
} }
"represents a request of any type" "represents a request of any type"

@ -101,7 +101,7 @@ export class Post extends Model<Post> {
* Returns if the post can be deleted by the user with the given id. * Returns if the post can be deleted by the user with the given id.
* @param userId * @param userId
*/ */
public async deleteable({userId}: {userId: number}): Promise<boolean> { public async deletable({userId}: {userId: number}): Promise<boolean> {
return Number(userId) === Number(this.authorId); return Number(userId) === Number(this.authorId);
} }
} }

Loading…
Cancel
Save