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

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

No files matched your search

+1 -1
View File
@@ -609,7 +609,7 @@ class NetworkService {
*/ */
async updateChecksTTL(config) { async updateChecksTTL(config) {
return this.axiosInstance.put( return this.axiosInstance.put(
`/checks/ttl`, `/checks/team/ttl`,
{ ttl: config.ttl }, { ttl: config.ttl },
{ {
headers: { headers: {
+61
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" "type": "string"
} }
} }
},
"UpdateCheckTTLBody": {
"type": "object",
"required": ["ttl"],
"properties": {
"ttl": {
"type": "integer"
}
}
} }
} }
} }
+1 -1
View File
@@ -25,7 +25,7 @@ router.delete(
); );
router.put( router.put(
"/ttl", "/team/ttl",
isAllowed(["admin", "superadmin"]), isAllowed(["admin", "superadmin"]),
checkController.updateChecksTTL checkController.updateChecksTTL
); );