Add testing endpoint to reset db tables (#716)
Fix lint Better error messages Add docs Add testing endpoint to reset db Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/716 Co-Authored-By: konrad <konrad@kola-entertainments.de> Co-Committed-By: konrad <konrad@kola-entertainments.de>
This commit is contained in:
@ -5605,6 +5605,47 @@ var doc = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/test/{table}": {
|
||||
"patch": {
|
||||
"description": "Fills the specified table with the content provided in the payload. You need to enable the testing endpoint before doing this and provide the ` + "`" + `Authorization: \u003ctoken\u003e` + "`" + ` secret when making requests to this endpoint. See docs for more details.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"testing"
|
||||
],
|
||||
"summary": "Reset the db to a defined state",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The table to reset",
|
||||
"name": "table",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Everything has been imported successfully.",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/user.User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
@ -5588,6 +5588,47 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/test/{table}": {
|
||||
"patch": {
|
||||
"description": "Fills the specified table with the content provided in the payload. You need to enable the testing endpoint before doing this and provide the `Authorization: \u003ctoken\u003e` secret when making requests to this endpoint. See docs for more details.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"testing"
|
||||
],
|
||||
"summary": "Reset the db to a defined state",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The table to reset",
|
||||
"name": "table",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Everything has been imported successfully.",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/user.User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
@ -4653,6 +4653,33 @@ paths:
|
||||
summary: Toggle a team member's admin status
|
||||
tags:
|
||||
- team
|
||||
/test/{table}:
|
||||
patch:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 'Fills the specified table with the content provided in the payload. You need to enable the testing endpoint before doing this and provide the `Authorization: <token>` secret when making requests to this endpoint. See docs for more details.'
|
||||
parameters:
|
||||
- description: The table to reset
|
||||
in: path
|
||||
name: table
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"201":
|
||||
description: Everything has been imported successfully.
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/user.User'
|
||||
type: array
|
||||
"500":
|
||||
description: Internal server error.
|
||||
schema:
|
||||
$ref: '#/definitions/models.Message'
|
||||
summary: Reset the db to a defined state
|
||||
tags:
|
||||
- testing
|
||||
/user:
|
||||
get:
|
||||
consumes:
|
||||
|
Reference in New Issue
Block a user