backend/source/api/actions/session_end.ts
Fenris Wolf aea08efed6 [int]
2024-09-13 17:49:32 +02:00

36 lines
753 B
TypeScript

namespace _zeitbild.api
{
/**
*/
export function register_session_end(
rest_subject : lib_plankton.rest.type_rest
) : void
{
register<null, null>(
rest_subject,
lib_plankton.http.enum_method.delete,
"/session/end",
{
"description": "beendet eine Sitzung",
"input_schema": () => ({
"type": "null",
}),
"output_schema": () => ({
"type": "null",
}),
"restriction": restriction_logged_in,
"execution": async (stuff) => {
const session : {key : string; value : lib_plankton.session.type_session} = await session_from_stuff(stuff);
await lib_plankton.session.end(session.key);
return Promise.resolve({
"status_code": 200,
"data": null,
});
},
}
);
}
}