Skip to content

wip: API for projects and boards #20208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 121 commits into from
Closed
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
091b549
test(projects): start of the implementations
dineshsalunke Jul 3, 2022
ce3dbfd
refactor(project): project and board swagger documentation
dineshsalunke Jul 3, 2022
781b1cc
refactor(project): fix some swagger errors
dineshsalunke Jul 3, 2022
7103a2c
refactor(project): minor cleanup
dineshsalunke Jul 9, 2022
45f44cb
refactor(api): try to match with github api
dineshsalunke Jul 9, 2022
d32ab45
Remove `GO111MODULE` (#20221)
Jul 4, 2022
fa3dc73
Allow enable LDAP source and disable user sync via CLI (#20206)
justusbunsi Jul 4, 2022
a7f1f6a
Allow dev i18n to be more concurrent (#20159)
zeripath Jul 4, 2022
31c847c
Add integration tests for the Gitea migration form (#20121)
realaravinth Jul 4, 2022
3814116
Adjust template for #20069 smallbell (#20108)
tyroneyeh Jul 4, 2022
db82c7c
Adjust class for mobile has the problem of double small bells (#20236)
tyroneyeh Jul 5, 2022
33eb19b
Display full name (#20171)
kimbj95 Jul 5, 2022
be710da
Adjust max-widths for the repository file table (#20243)
zeripath Jul 5, 2022
1890c80
Bypass Firefox (iOS) bug (#20244)
wxiaoguang Jul 5, 2022
2b86075
Init popup for new code comment (#20234)
Jul 5, 2022
b010ac6
Only show Followers that current user can access (#20220)
zeripath Jul 5, 2022
e0b93f5
EscapeFilter the group dn membership (#20200)
zeripath Jul 5, 2022
559b2bf
Bump mermaid from 9.1.1 to 9.1.2 (#20256)
dependabot[bot] Jul 6, 2022
957836f
Refix notification bell placement (#20251)
zeripath Jul 6, 2022
053c5f6
Allow RSA 2047 bit keys (#20272)
zeripath Jul 6, 2022
4d769e5
Fix toolip on mobile notification bell (#20270)
zeripath Jul 6, 2022
392f27f
Modify milestone search keywords to be case insensitive (#20266)
tyroneyeh Jul 6, 2022
92aede0
Fix NPE when using non-numeric (#20277)
Jul 7, 2022
176015c
Add tooltip to repo icons in explore page (#20241)
renbaoshuo Jul 7, 2022
c59d9c4
Use git.HOME_PATH for Git HOME directory (#20114)
wxiaoguang Jul 8, 2022
b9fbab3
Implement sync push mirror on commit (#19411)
harryzcy Jul 8, 2022
0b19a3b
Do not create empty ".ssh" directory when loading config (#20289)
wxiaoguang Jul 9, 2022
1a33414
Merge branch 'main' into projects-api
6543 Jul 9, 2022
a94f127
refactor(swagger): added the missing comments
dineshsalunke Jul 13, 2022
6fb081b
refactor(api): add paging query for list endpoints
dineshsalunke Jul 14, 2022
e192014
chore(swagger): add missing swagger documentation
dineshsalunke Jul 14, 2022
c060beb
refactor(integrations): add boilerplate file project and board tests
dineshsalunke Jul 14, 2022
cef8c54
feat(projects): api for projects
dineshsalunke Jul 14, 2022
ed8543a
Merge branch 'main' into projects-api
dineshsalunke Jul 15, 2022
649042f
Include login_name in adminCreateUser response (#20283)
kimbj95 Jul 15, 2022
03d146c
Fix eslint parsing errors, remove eslint-plugin-html (#20323)
silverwind Jul 15, 2022
c759cb9
Fix commit status icon when in subdirectory (#20285)
silverwind Jul 15, 2022
a6f1d33
Allow access to the Public Organization Member lists with minimal per…
a1012112796 Jul 15, 2022
498dd78
Initialize cron last (#20373)
zeripath Jul 15, 2022
264f02d
Set target on create release with existing tag (#20381)
Jul 15, 2022
3b81e40
Use git.HOME_PATH for Git HOME directory (#20114)
wxiaoguang Jul 8, 2022
16d9f5c
Implement sync push mirror on commit (#19411)
harryzcy Jul 8, 2022
3916df6
refactor(): add missing return statement
dineshsalunke Jul 15, 2022
23d883f
feat(board): endpoints for board
dineshsalunke Jul 16, 2022
9a9ae85
chore(): swagger def update
dineshsalunke Jul 16, 2022
62a3eb0
Merge branch 'main' into projects-api
dineshsalunke Jul 16, 2022
1fd61f8
refactor(): fix swagger lint issues
dineshsalunke Jul 16, 2022
23e5fd0
Merge branch 'main' into projects-api
dineshsalunke Jul 24, 2022
11a55a0
Merge branch 'main' into projects-api
6543 Sep 24, 2022
b73c091
adjust to latest refactors
6543 Sep 24, 2022
e26057d
Apply suggestions from code review
6543 Sep 24, 2022
d3e7f2c
Update models/project/board.go
6543 Sep 24, 2022
8bf5e48
Update models/project/board.go
6543 Sep 24, 2022
503d2c1
fix build
6543 Sep 24, 2022
8804733
update unit tests
6543 Sep 24, 2022
6fbcb6e
use caching to load Attributes on lists
6543 Sep 24, 2022
855758b
fix revive
6543 Sep 24, 2022
2023f56
fix lint
6543 Sep 24, 2022
21d1dfb
Merge branch 'main' into projects-api
6543 Sep 25, 2022
317a361
Merge branch 'main' into projects-api
6543 Oct 8, 2022
8fd34df
Merge branch 'main' into projects-api
6543 Oct 22, 2022
252ecd8
Merge branch 'main' into projects-api
dineshsalunke Dec 23, 2022
b9a3748
refactor: remove Ctx suffix
dineshsalunke Dec 23, 2022
c64e6b6
refactor: split the list in new file
dineshsalunke Dec 23, 2022
b5d9130
refactor: check if the repos are same
dineshsalunke Dec 23, 2022
857225e
fix: add permissions check
dineshsalunke Dec 23, 2022
221b659
chore: add copyright header
dineshsalunke Dec 23, 2022
8ffbea8
Merge branch 'main' into projects-api
dineshsalunke Dec 23, 2022
12b2816
Merge branch 'main' into projects-api
dineshsalunke Dec 26, 2022
f10c990
Merge branch 'main' into projects-api
dineshsalunke Dec 29, 2022
8f93aa6
Merge branch 'main' into projects-api
dineshsalunke Jan 4, 2023
8c6d45c
chore: update the copyrights
dineshsalunke Jan 13, 2023
c5880c7
Merge branch 'main' into projects-api
dineshsalunke Jan 13, 2023
dd364c9
Merge branch 'main' of https://github.com/dineshsalunke/gitea into pr…
dineshsalunke Jan 13, 2023
22959c4
Merge branch 'projects-api' of https://github.com/dineshsalunke/gitea…
dineshsalunke Jan 13, 2023
9161303
Merge branch 'main' into projects-api
dineshsalunke Jan 14, 2023
461950e
refactor: update the imports
dineshsalunke Jan 14, 2023
f2c55f6
refactor: update imports and remove redundant condition
dineshsalunke Jan 14, 2023
88f7ae0
refactor: check for the repo ids
dineshsalunke Jan 14, 2023
187e27b
Merge branch 'main' into projects-api
dineshsalunke Jan 16, 2023
edc3446
refactor: add permissions
dineshsalunke Jan 18, 2023
78aa83b
Merge branch 'main' into projects-api
dineshsalunke Jan 18, 2023
0f4be83
Merge branch 'main' of https://github.com/go-gitea/gitea into project…
dineshsalunke Jan 18, 2023
58ef609
Merge branch 'projects-api' of https://github.com/dineshsalunke/gitea…
dineshsalunke Jan 18, 2023
79667a3
Merge branch 'main' into projects-api
techknowlogick Jan 24, 2023
479014c
Update modules/structs/project.go
techknowlogick Jan 24, 2023
85e0a0b
Update routers/api/v1/repo/board.go
techknowlogick Jan 24, 2023
e8769cd
Update routers/api/v1/repo/project.go
techknowlogick Jan 24, 2023
dd422c3
placate lint
techknowlogick Jan 25, 2023
f2369e4
refactor: remove trace line
dineshsalunke Feb 14, 2023
93ee056
Merge branch 'main' into projects-api
6543 Apr 3, 2023
957f0a3
Merge branch 'main' into projects-api
dineshsalunke Jul 11, 2023
bdb217c
Merge branch 'main' into projects-api
GiteaBot Aug 3, 2023
ff5a443
Merge branch 'main' into projects-api
dineshsalunke Aug 16, 2023
2fce167
Merge branch 'main' into projects-api
GiteaBot Sep 10, 2023
f3b5447
Merge remote-tracking branch 'upstream/main' into projects-api
dineshsalunke Oct 2, 2023
89914eb
Merge branch 'projects-api' of https://github.com/dineshsalunke/gitea…
dineshsalunke Oct 2, 2023
aa7e2a4
Merge remote-tracking branch 'upstream/main' into projects-api
dineshsalunke Oct 16, 2023
f1aa661
refactor; remove the redudant functions
dineshsalunke Oct 17, 2023
43ff02a
refactor: add method on project struct instead of exposing it from mo…
dineshsalunke Oct 17, 2023
a9d6f0d
refactor: add the context parameter
dineshsalunke Oct 17, 2023
4b99ba2
refactor: add the context parameter
dineshsalunke Oct 17, 2023
2570b39
refactor: use the method on project struct
dineshsalunke Oct 17, 2023
ce9a62a
refactor: add the context parameter
dineshsalunke Oct 17, 2023
2fb7328
refactor: organize everything related to projects api in its own module
dineshsalunke Oct 18, 2023
c552a56
refactor: update the swagger documentation
dineshsalunke Oct 18, 2023
e405015
chore: remove the redundant test fixture
dineshsalunke Oct 18, 2023
eb0d417
refactor: add empty some empty methods with swagger docs
dineshsalunke Oct 18, 2023
edeed31
refactor: update the swagger documentation
dineshsalunke Oct 18, 2023
bc4420c
Merge branch 'main' into projects-api
dineshsalunke Oct 18, 2023
47ce10c
refactor: empty the previous test's in order to write anew
dineshsalunke Oct 19, 2023
7d68621
Merge branch 'projects-api' of https://github.com/dineshsalunke/gitea…
dineshsalunke Oct 19, 2023
575c3b1
refactor: add cardtype field to create project payload
dineshsalunke Oct 20, 2023
db684a9
refactor: add the projects endpoints to the router
dineshsalunke Oct 20, 2023
92722d8
Merge remote-tracking branch 'upstream/main' into projects-api
dineshsalunke Oct 23, 2023
3d0a4e9
Merge remote-tracking branch 'upstream/main' into projects-api
dineshsalunke Nov 6, 2023
1676b4d
Merge remote-tracking branch 'upstream/main' into projects-api
dineshsalunke Nov 10, 2023
ff9ac96
Merge branch 'projects-api' of https://github.com/dineshsalunke/gitea…
dineshsalunke Nov 10, 2023
22177d4
chore: add fixture for project on organization
dineshsalunke Nov 10, 2023
732727c
fix: ignore loading and converting of Repo on projects assgined to org
dineshsalunke Nov 10, 2023
ac02a7c
test: add test for list org projects
dineshsalunke Nov 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions models/fixtures/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
board_type: 1
type: 2

-
id: 4
title: Fourth project
description: This is fourth project
repo_id: 1
is_closed: true
creator_id: 2
board_type: 1
type: 2

-
id: 2
title: second project
Expand Down
80 changes: 78 additions & 2 deletions models/project/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"regexp"

"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"

Expand Down Expand Up @@ -45,8 +46,10 @@ type Board struct {
Sorting int8 `xorm:"NOT NULL DEFAULT 0"`
Color string `xorm:"VARCHAR(7)"`

ProjectID int64 `xorm:"INDEX NOT NULL"`
CreatorID int64 `xorm:"NOT NULL"`
ProjectID int64 `xorm:"INDEX NOT NULL"`
Project *Project `xorm:"-"`
CreatorID int64 `xorm:"NOT NULL"`
Creator *user_model.User `xorm:"-"`

CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
Expand Down Expand Up @@ -223,6 +226,22 @@ func GetBoards(ctx context.Context, projectID int64) (BoardList, error) {
return append([]*Board{defaultB}, boards...), nil
}

func GetBoardsAndCount(ctx context.Context, projectID int64) (BoardList, int64, error) {
engine := db.GetEngine(ctx)
boards := make([]*Board, 0, 10)

defaultB, err := getDefaultBoard(ctx, projectID)
if err != nil {
return nil, 0, err
}

count, err := engine.Where("project_id=? AND `default`=?", projectID, false).OrderBy("Sorting").FindAndCount(&boards)
if err != nil {
return nil, 0, err
}
return append([]*Board{defaultB}, boards...), count + 1, nil
}

// getDefaultBoard return default board and create a dummy if none exist
func getDefaultBoard(ctx context.Context, projectID int64) (*Board, error) {
var board Board
Expand Down Expand Up @@ -273,3 +292,60 @@ func UpdateBoardSorting(bs BoardList) error {
}
return nil
}

// LoadBoardCreator load creator of project board.
func (b *Board) LoadBoardCreator(ctx context.Context) (err error) {
if b.Creator == nil {
b.Creator, err = user_model.GetUserByID(ctx, b.CreatorID)
if err != nil {
return fmt.Errorf("getUserByID [%d]: %v", b.CreatorID, err)
}
}
return nil
}

// LoadProject load project of project board.
func (b *Board) LoadProject(ctx context.Context) (err error) {
if b.Project == nil {
b.Project, err = GetProjectByID(ctx, b.ProjectID)
if err != nil {
return fmt.Errorf("getProjectByID [%d]: %v", b.CreatorID, err)
}
}
return nil
}

// LoadAttributes load projects and creators of project boards.
func (bl BoardList) LoadAttributes(ctx context.Context) (err error) {
creators := make(map[int64]*user_model.User)
projects := make(map[int64]*Project)
var ok bool

for i := range bl {
if bl[i].Project == nil {
bl[i].Project, ok = projects[bl[i].ProjectID]
if !ok {
project, err := GetProjectByID(ctx, bl[i].ProjectID)
if err != nil {
return fmt.Errorf("getProjectByID [%d]: %v", bl[i].ProjectID, err)
}
bl[i].Project = project
projects[bl[i].ProjectID] = project
}
}

if bl[i].Creator == nil {
bl[i].Creator, ok = creators[bl[i].CreatorID]
if !ok {
creator, err := user_model.GetUserByID(ctx, bl[i].CreatorID)
if err != nil {
return fmt.Errorf("getUserByID [%d]: %v", bl[i].CreatorID, err)
}
bl[i].Creator = creator
creators[bl[i].CreatorID] = creator
}
}
}

return nil
}
34 changes: 26 additions & 8 deletions models/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func (err ErrProjectBoardNotExist) Unwrap() error {
return util.ErrNotExist
}

// List is a list of projects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

// type List []*Project

// Project represents a project board
type Project struct {
ID int64 `xorm:"pk autoincr"`
Expand All @@ -89,6 +92,7 @@ type Project struct {
RepoID int64 `xorm:"INDEX"`
Repo *repo_model.Repository `xorm:"-"`
CreatorID int64 `xorm:"NOT NULL"`
Creator *user_model.User `xorm:"-"`
IsClosed bool `xorm:"INDEX"`
BoardType BoardType
Type Type
Expand All @@ -108,14 +112,6 @@ func (p *Project) LoadOwner(ctx context.Context) (err error) {
return err
}

func (p *Project) LoadRepo(ctx context.Context) (err error) {
if p.RepoID == 0 || p.Repo != nil {
return nil
}
p.Repo, err = repo_model.GetRepositoryByID(ctx, p.RepoID)
return err
}

func (p *Project) Link() string {
if p.OwnerID > 0 {
err := p.LoadOwner(db.DefaultContext)
Expand Down Expand Up @@ -389,6 +385,28 @@ func DeleteProjectByID(ctx context.Context, id int64) error {
})
}

// LoadRepo load repo of the project.
func (p *Project) LoadRepo(ctx context.Context) (err error) {
if p.Repo == nil {
p.Repo, err = repo_model.GetRepositoryByID(ctx, p.RepoID)
if err != nil {
return fmt.Errorf("getRepositoryByID [%d]: %v", p.RepoID, err)
}
}
return nil
}

// LoadCreator load creator of the project.
func (p *Project) LoadCreator(ctx context.Context) (err error) {
if p.Creator == nil {
p.Creator, err = user_model.GetUserByID(ctx, p.CreatorID)
if err != nil {
return fmt.Errorf("getUserByID [%d]: %v", p.CreatorID, err)
}
}
return nil
}

func DeleteProjectByRepoID(ctx context.Context, repoID int64) error {
switch {
case setting.Database.UseSQLite3:
Expand Down
49 changes: 49 additions & 0 deletions models/project/project_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2023 The Gitea Authors. All rights reserved.

...

// SPDX-License-Identifier: MIT
package project

import (
"context"
"fmt"

repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
)

// List is a list of projects
type List []*Project

// LoadAttributes load repos and creators of projects.
func (pl List) LoadAttributes(ctx context.Context) (err error) {
repos := make(map[int64]*repo_model.Repository)
creators := make(map[int64]*user_model.User)
var ok bool

for i := range pl {
if pl[i].Repo == nil {
pl[i].Repo, ok = repos[pl[i].RepoID]
if !ok {
repo, err := repo_model.GetRepositoryByID(ctx, pl[i].RepoID)
if err != nil {
return fmt.Errorf("getRepositoryByID [%d]: %v", pl[i].RepoID, err)
}
pl[i].Repo = repo
repos[pl[i].RepoID] = repo
}
}

if pl[i].Creator == nil {
pl[i].Creator, ok = creators[pl[i].CreatorID]
if !ok {
creator, err := user_model.GetUserByID(ctx, pl[i].CreatorID)
if err != nil {
return fmt.Errorf("getUserByID [%d]: %v", pl[i].CreatorID, err)
}
pl[i].Creator = creator
creators[pl[i].CreatorID] = creator
}
}
}

return nil
}
4 changes: 2 additions & 2 deletions models/project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func TestGetProjects(t *testing.T) {
projects, _, err := FindProjects(db.DefaultContext, SearchOptions{RepoID: 1})
assert.NoError(t, err)

// 1 value for this repo exists in the fixtures
assert.Len(t, projects, 1)
// this repo has two projects in the fixtures
assert.Len(t, projects, 2)

projects, _, err = FindProjects(db.DefaultContext, SearchOptions{RepoID: 3})
assert.NoError(t, err)
Expand Down
68 changes: 68 additions & 0 deletions modules/structs/project.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package structs

import "time"

// swagger:model
type NewProjectPayload struct {
// required:true
Title string `json:"title" binding:"Required"`
// required:true
BoardType uint8 `json:"board_type"`
Description string `json:"description"`
}

// swagger:model
type UpdateProjectPayload struct {
// required:true
Title string `json:"title" binding:"Required"`
Description string `json:"description"`
}

type Project struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
BoardType uint8 `json:"board_type"`
IsClosed bool `json:"is_closed"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
Updated time.Time `json:"updated_at"`
// swagger:strfmt date-time
Closed time.Time `json:"closed_at"`

Repo *RepositoryMeta `json:"repository"`
Creator *User `json:"creator"`
}

type ProjectBoard struct {
ID int64 `json:"id"`
Title string `json:"title"`
Default bool `json:"default"`
Color string `json:"color"`
Sorting int8 `json:"sorting"`
Project *Project `json:"project"`
Creator *User `json:"creator"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
Updated time.Time `json:"updated_at"`
}

// swagger:model
type NewProjectBoardPayload struct {
// required:true
Title string `json:"title"`
Default bool `json:"default"`
Color string `json:"color"`
Sorting int8 `json:"sorting"`
}

// swagger:model
type UpdateProjectBoardPayload struct {
Title string `json:"title"`
Color string `json:"color"`
}
26 changes: 26 additions & 0 deletions routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,11 @@ func Routes(ctx gocontext.Context) *web.Route {
}, mustEnableAttachments)
})
}, mustEnableIssuesOrPulls)
m.Group("/projects", func() {
m.Combo("").
Get(reqToken(auth_model.AccessTokenScopeRepo), repo.ListRepositoryProjects).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used Repo Scope for project boards, but this probably needs to be reviewed as to which scope is most appropriate.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these all possible Scopes? There is nothing else except AccessTokenScopeRepo to fit then

Post(reqToken(auth_model.AccessTokenScopeRepo), mustNotBeArchived, bind(api.NewProjectPayload{}), repo.CreateRepositoryProject)
})
m.Group("/labels", func() {
m.Combo("").Get(repo.ListLabels).
Post(reqToken(auth_model.AccessTokenScopeRepo), reqRepoWriter(unit.TypeIssues, unit.TypePullRequests), bind(api.CreateLabelOption{}), repo.CreateLabel)
Expand Down Expand Up @@ -1226,6 +1231,27 @@ func Routes(ctx gocontext.Context) *web.Route {
m.Group("/topics", func() {
m.Get("/search", repo.TopicSearch)
})

// Projects
m.Group("/projects", func() {
m.Group("/{id}", func() {
m.Combo("").
Get(reqToken(auth_model.AccessTokenScopeRepo), reqRepoReader(unit.TypeProjects), repo.GetProject).
Patch(reqToken(auth_model.AccessTokenScopeRepo), reqRepoWriter(unit.TypeProjects), bind(api.UpdateProjectPayload{}), repo.UpdateProject).
Delete(reqToken(auth_model.AccessTokenScopeRepo), reqRepoWriter(unit.TypeProjects), repo.DeleteProject)

m.Combo("/boards").
Post(reqToken(auth_model.AccessTokenScopeRepo), reqRepoWriter(unit.TypeProjects), bind(api.NewProjectBoardPayload{}), repo.CreateProjectBoard).
Get(reqToken(auth_model.AccessTokenScopeRepo), reqRepoReader(unit.TypeProjects), repo.ListProjectBoards)
})

m.Group("/boards", func() {
m.Combo("/{id}").
Get(reqToken(auth_model.AccessTokenScopeRepo), repo.GetProjectBoard).
Patch(reqToken(auth_model.AccessTokenScopeRepo), bind(api.UpdateProjectBoardPayload{}), repo.UpdateProjectBoard).
Delete(reqToken(auth_model.AccessTokenScopeRepo), repo.DeleteProjectBoard)
})
})
}, sudo())

return m
Expand Down
Loading