63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
namespace _espe.api
|
|
{
|
|
|
|
/**
|
|
* @todo ausgeklügelte Durchsatzratenbegrenzung
|
|
*/
|
|
export function register_member_password_change_execute(
|
|
rest_subject : lib_plankton.rest.type_rest
|
|
) : void
|
|
{
|
|
register<
|
|
{
|
|
token : string;
|
|
password_new : string;
|
|
},
|
|
null
|
|
>(
|
|
rest_subject,
|
|
lib_plankton.http.enum_method.patch,
|
|
"/member/password_change/execute/:id",
|
|
{
|
|
"description": "Führt eine Passwort-Änderung für ein Mitglied durch",
|
|
"input_schema": () => ({
|
|
"nullable": false,
|
|
"type": "object",
|
|
"properties": {
|
|
"token": {
|
|
"nullable": false,
|
|
"type": "string"
|
|
},
|
|
"password_new": {
|
|
"nullable": false,
|
|
"type": "string",
|
|
"description": "das neue Passwort"
|
|
},
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"token",
|
|
"password_new",
|
|
]
|
|
}),
|
|
"output_schema": () => ({
|
|
"nullable": true
|
|
}),
|
|
"restriction": restriction_none,
|
|
"execution": async ({"path_parameters": path_parameters, "input": input}) => {
|
|
const member_id : _espe.type.member_id = parseInt(path_parameters["id"]);
|
|
await _espe.service.member.password_change_execute(
|
|
member_id,
|
|
input.token,
|
|
input.password_new
|
|
);
|
|
return Promise.resolve({
|
|
"status_code": 200,
|
|
"data": null
|
|
});
|
|
},
|
|
}
|
|
)
|
|
}
|
|
|
|
}
|