mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
add: project unit list
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
class Projects::ProjectUnitsController < Projects::BaseController
|
||||
def index
|
||||
@project_units = @project.project_units
|
||||
end
|
||||
|
||||
def create
|
||||
if current_user.admin? || @project.owner?(current_user)
|
||||
ActiveRecord::Base.transaction do
|
||||
|
||||
@@ -261,8 +261,46 @@ attachments |array|附件
|
||||
Remember — a happy kitten is an authenticated kitten!
|
||||
</aside>
|
||||
|
||||
## 更改项目导航
|
||||
更改项目导航信息
|
||||
## 项目模块信息
|
||||
项目模块信息
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET \
|
||||
http://localhost:3000/api/yystopf/ceshi/project_units.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/yystopf/ceshi/project_units')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/yystopf/ceshi/project_units`
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|type |string|模块名称 |
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"type": "code"
|
||||
},
|
||||
{
|
||||
"type": "pulls"
|
||||
},
|
||||
{
|
||||
"type": "issues"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## 更改项目模块展示
|
||||
更改项目模块展示
|
||||
|
||||
> 示例:
|
||||
|
||||
|
||||
3
app/views/projects/project_units/index.json.jbuilder
Normal file
3
app/views/projects/project_units/index.json.jbuilder
Normal file
@@ -0,0 +1,3 @@
|
||||
json.array! @project_units do |unit|
|
||||
json.type unit.unit_type
|
||||
end
|
||||
Reference in New Issue
Block a user