refactor ttl endpoint path, add /team/ttl to docs

This commit is contained in:
Alex Holliday
2024-09-25 11:37:52 +08:00
parent c44152de93
commit 36014fada2
3 changed files with 63 additions and 2 deletions

View File

@@ -609,7 +609,7 @@ class NetworkService {
*/
async updateChecksTTL(config) {
return this.axiosInstance.put(
`/checks/ttl`,
`/checks/team/ttl`,
{ ttl: config.ttl },
{
headers: {

View File

@@ -1669,6 +1669,58 @@
}
]
}
},
"/checks/team/ttl": {
"put": {
"tags": ["checks"],
"description": "Update check TTL",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateCheckTTLBody"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessResponse"
}
}
}
},
"422": {
"description": "Unprocessable Content",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}
}
},
@@ -1833,6 +1885,15 @@
"type": "string"
}
}
},
"UpdateCheckTTLBody": {
"type": "object",
"required": ["ttl"],
"properties": {
"ttl": {
"type": "integer"
}
}
}
}
}

View File

@@ -25,7 +25,7 @@ router.delete(
);
router.put(
"/ttl",
"/team/ttl",
isAllowed(["admin", "superadmin"]),
checkController.updateChecksTTL
);