Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iGEM.org Backend
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iGEM HQ Tech
iGEM.org Backend
Commits
c6bbec0f
Commit
c6bbec0f
authored
4 months ago
by
Fabio Maschi
Browse files
Options
Downloads
Patches
Plain Diff
feat/revert-endpoint
parent
fdaf8074
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/teams-management/teams/params/competition-slug.params.ts
+11
-0
11 additions, 0 deletions
.../teams-management/teams/params/competition-slug.params.ts
src/modules/teams-management/teams/teams.controller.ts
+10
-0
10 additions, 0 deletions
src/modules/teams-management/teams/teams.controller.ts
with
21 additions
and
0 deletions
src/modules/teams-management/teams/params/competition-slug.params.ts
0 → 100644
+
11
−
0
View file @
c6bbec0f
import
{
IsUUID
}
from
'
class-validator
'
import
{
IsSlug
}
from
'
core/validators/is-slug
'
import
{
CompetitionUUID
}
from
'
modules/common/types/competition-uuid.type
'
export
class
CompetitionSlugParams
{
@
IsUUID
()
competitionUUID
:
CompetitionUUID
@
IsSlug
()
slug
:
string
}
This diff is collapsed.
Click to expand it.
src/modules/teams-management/teams/teams.controller.ts
+
10
−
0
View file @
c6bbec0f
...
...
@@ -33,6 +33,7 @@ import { TeamQueriesService } from 'modules/teams-management/teams/team-queries.
import
{
TeamTicketAndOrderSummary
}
from
'
./dto/team-order-ticket-summary.dto
'
import
{
AssertIsPIGuard
}
from
'
./guards/assert-is-pi.guard
'
import
{
AssertIsTeamPrimaryPIGuard
}
from
'
./guards/assert-is-team-primary-pi.guard
'
import
{
CompetitionSlugParams
}
from
'
./params/competition-slug.params
'
import
{
PaginatedTeam
,
Team
}
from
'
./team.entity
'
import
{
TeamsService
}
from
'
./teams.service
'
...
...
@@ -72,6 +73,15 @@ export class TeamsController {
return
await
this
.
service
.
findAll
(
params
.
competitionUUID
)
}
// Used to redirect attributions.igem.org/year/team-slug to teams.igem.org/teamID/attributions
// https://gitlab.igem.org/websites/redirects/attributions/-/blob/main/public/index.html?ref_type=heads#L25
@
Get
(
'
competitions/:competitionUUID/teams/:slug
'
)
@
UseInterceptors
(
CacheInterceptor
)
@
UseInterceptors
(
MapInterceptor
(
Team
,
TeamDTO
))
async
findBySlug
(@
Param
()
params
:
CompetitionSlugParams
):
Promise
<
Team
>
{
return
await
this
.
service
.
findOneBySlug
(
params
.
competitionUUID
,
params
.
slug
)
}
//
// TEAMS
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment