backend/source/api/actions/member_summon.ts

36 lines
839 B
TypeScript
Raw Normal View History

2024-04-29 22:40:52 +02:00
namespace _espe.api
{
/**
*/
export function register_member_summon(
rest_subject : lib_plankton.rest.type_rest
) : void
{
lib_plankton.rest.register<
{
url_template : string;
},
2024-04-30 19:05:23 +02:00
string
2024-04-29 22:40:52 +02:00
>(
rest_subject,
lib_plankton.http.enum_method.post,
2024-04-30 19:05:23 +02:00
_espe.conf.get().server.path_base + "/member/summon/:id",
2024-04-29 22:40:52 +02:00
{
"description": "sendet an ein Mitglied eine E-Mail mit Aufforderung zur Registrierung",
"restriction": restriction_logged_in,
"execution": async ({"path_parameters": path_parameters, "input": input}) => {
const member_id : _espe.type.member_id = parseInt(path_parameters["id"]);
2024-04-30 19:05:23 +02:00
const url : string = await _espe.service.member.summon(member_id, input.url_template);
2024-04-29 22:40:52 +02:00
return Promise.resolve({
"status_code": 200,
2024-04-30 19:05:23 +02:00
"data": url,
2024-04-29 22:40:52 +02:00
});
}
}
);
}
}