Change to use some simplified mapping attributes.
Build and Deploy API / build-and-deploy (push) Successful in 1m45s
Details
Build and Deploy API / build-and-deploy (push) Successful in 1m45s
Details
This commit is contained in:
parent
669fecf441
commit
be3d554b7f
|
|
@ -10,7 +10,7 @@ import auth.data;
|
|||
import auth.service;
|
||||
import auth.data_impl_fs;
|
||||
|
||||
@PathMapping(HttpMethod.POST, "/api/login")
|
||||
@PostMapping("/api/login")
|
||||
void postLogin(ref ServerHttpRequest request, ref ServerHttpResponse response) {
|
||||
struct LoginData {
|
||||
string username;
|
||||
|
|
@ -26,7 +26,7 @@ struct UsernameAvailabilityResponse {
|
|||
const bool available;
|
||||
}
|
||||
|
||||
@PathMapping(HttpMethod.GET, "/api/register/username-availability")
|
||||
@GetMapping("/api/register/username-availability")
|
||||
void getUsernameAvailability(ref ServerHttpRequest request, ref ServerHttpResponse response) {
|
||||
string username = null;
|
||||
foreach (param; request.queryParams) {
|
||||
|
|
@ -50,7 +50,7 @@ struct RegistrationData {
|
|||
string password;
|
||||
}
|
||||
|
||||
@PathMapping(HttpMethod.POST, "/api/register")
|
||||
@PostMapping("/api/register")
|
||||
void postRegister(ref ServerHttpRequest request, ref ServerHttpResponse response) {
|
||||
RegistrationData registrationData = readJsonBodyAs!RegistrationData(request);
|
||||
if (!validateUsername(registrationData.username)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue