Add swagger docs
This commit is contained in:
parent
68aa26adad
commit
6b4a26b9f0
|
@ -25,11 +25,12 @@ import (
|
|||
// ListDuplicate holds everything needed to duplicate a list
|
||||
type ListDuplicate struct {
|
||||
// The list id of the list to duplicate
|
||||
ListID int64 `json:"list_id"`
|
||||
// The target namespace
|
||||
NamespaceID int64 `json:"namespace_id"`
|
||||
ListID int64 `json:"-" param:"list"`
|
||||
// The target namespace ID
|
||||
NamespaceID int64 `json:"namespace_id,omitempty"`
|
||||
|
||||
List *List `json:"-"`
|
||||
// The copied list
|
||||
List *List `json:",omitempty"`
|
||||
|
||||
web.Rights `json:"-"`
|
||||
web.CRUDable `json:"-"`
|
||||
|
@ -50,6 +51,19 @@ func (ld *ListDuplicate) CanCreate(a web.Auth) (canCreate bool, err error) {
|
|||
}
|
||||
|
||||
// Create duplicates a list
|
||||
// @Summary Duplicate an existing list
|
||||
// @Description Copies the list, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one list to a new namespace. The user needs read access in the list and write access in the namespace of the new list.
|
||||
// @tags list
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security JWTKeyAuth
|
||||
// @Param listID path int true "The list ID to duplicate"
|
||||
// @Param list body models.ListDuplicate true "The target namespace which should hold the copied list."
|
||||
// @Success 200 {object} models.ListDuplicate "The created list."
|
||||
// @Failure 400 {object} web.HTTPError "Invalid list duplicate object provided."
|
||||
// @Failure 403 {object} web.HTTPError "The user does not have access to the list or namespace"
|
||||
// @Failure 500 {object} models.Message "Internal error"
|
||||
// @Router /lists/{listID}/duplicate [put]
|
||||
func (ld *ListDuplicate) Create(a web.Auth) (err error) {
|
||||
|
||||
ld.List.ID = 0
|
||||
|
|
Loading…
Reference in New Issue