Compare commits

..

3 Commits

Author SHA1 Message Date
tracer 1cfd2bc91c changed endpoints to id
Signed-off-by: tracer <tracer@24unix.net>
2022-02-06 19:01:37 +01:00
tracer a92bff0502 removed trash from whereever …
Signed-off-by: tracer <tracer@24unix.net>
2022-02-06 19:01:09 +01:00
tracer d6cdc7b5a2 changed domain name => id
Signed-off-by: tracer <tracer@24unix.net>
2022-02-06 19:00:30 +01:00
3 changed files with 34 additions and 23 deletions

View File

@ -106,13 +106,13 @@
} }
} }
}, },
"/domains/{name}": { "/domains/{id}": {
"get": { "get": {
"tags": [ "tags": [
"Domains" "Domains"
], ],
"summary": "Returns a single domain.", "summary": "Returns a single domain.",
"description": "Returns information of a single domain specified by its domain name.", "description": "Returns information of a single domain specified by its ID.",
"operationId": "getSingleDomain", "operationId": "getSingleDomain",
"parameters": [ "parameters": [
{ {
@ -207,6 +207,37 @@
} }
] ]
} }
},
"/domains/name/{name}": {
"get": {
"tags": [
"Domains"
],
"summary": "Returns a single domain by name.",
"description": "Returns information of a single domain specified by its domain name.",
"operationId": "getSingleDomain",
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/200-ok"
},
"400": {
"$ref": "#/components/responses/400-bad-request"
},
"401": {
"$ref": "#/components/responses/401-unauthorized"
}
}
}
} }
}, },
"components": { "components": {

View File

@ -9,26 +9,6 @@
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32"/> <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32"/>
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16"/> <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16"/>
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
body {
margin: 0;
background: #fafafa;
}
</style>
</head> </head>
<body> <body>

View File

@ -295,7 +295,7 @@ class RequestController
if (empty($this->uri[3])) { if (empty($this->uri[3])) {
$this->handleAllDomainsGetRequest(); $this->handleAllDomainsGetRequest();
} else { } else {
if ($result = $this->domainRepository->findByName(name: $this->uri[3])) { if ($result = $this->domainRepository->findById(id: $this->uri[3])) {
$domain = [ $domain = [
'id' => $result->getId(), 'id' => $result->getId(),
'name' => $result->getName(), 'name' => $result->getName(),