-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First Beta Release. (WithOut Authentication)
Added Pluckable URL for users and projects Added Relationships among entities. Deletions Handled Gracefully. Completed Middlewares. Projects sharing among members. Added Roles .... and many bug fixes
- Loading branch information
Showing
22 changed files
with
495 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use strict' | ||
|
||
const Team = use('App/Models/Team'); | ||
|
||
class TeamFindFromBody { | ||
async handle({request, response}, next) { | ||
|
||
const { | ||
_team_id | ||
} = request.all(); | ||
|
||
if (_team_id === undefined || _team_id === null) | ||
{ | ||
return response.status(400).json({ | ||
status: 'ERROR', | ||
message: `No TeamId found.` | ||
}); | ||
} | ||
|
||
let team = await Team.find(_team_id); | ||
|
||
if (team.$attributes.hasOwnProperty("deleted_at")) | ||
{ | ||
return response.status(400).json({ | ||
status: 'ERROR', | ||
message: `No with team id: ${_team_id} has been removed or does not exists` | ||
}); | ||
} | ||
|
||
// add the request to the body. | ||
request.body.team = team; | ||
|
||
// call next to advance the request | ||
await next() | ||
} | ||
} | ||
|
||
module.exports = TeamFindFromBody; |
Oops, something went wrong.