member communication

This commit is contained in:
Anton Schegg 2025-01-05 17:46:31 +01:00
parent 2398084764
commit 93afdec274

View file

@ -462,6 +462,7 @@ router.get("/", async (req, res) => {
}
// add communications
if (!queryResultElement.verzogen) {
const createCommunicationCommands: CreateCommunicationCommand[] = [];
let havePreferred = false;
if (queryResultElement.Mobiltelefon && !queryResultElement.verstorben && !queryResultElement.verzogenDatum) {
@ -472,6 +473,7 @@ router.get("/", async (req, res) => {
city: "",
email: "",
mobile: queryResultElement.Mobiltelefon.trim(),
postalCode: "",
preferred: false,
street: "",
streetNumber: 0,
@ -488,6 +490,7 @@ router.get("/", async (req, res) => {
email: queryResultElement.email,
mobile: "",
preferred: queryResultElement.EinladungNurPerEmail,
postalCode: "",
street: "",
streetNumber: 0,
streetNumberAddition: "",
@ -506,6 +509,7 @@ router.get("/", async (req, res) => {
city: "",
email: "",
mobile: queryResultElement.Mobiltelefon.trim(),
postalCode: "",
preferred: preferred,
street: "",
streetNumber: 0,
@ -526,6 +530,7 @@ router.get("/", async (req, res) => {
email: "",
mobile: "",
preferred: preferred,
postalCode: queryResultElement.PLZ,
street: queryResultElement.street.trim(),
streetNumber: queryResultElement.streetnumber,
streetNumberAddition: queryResultElement.streetnumberaddition.trim(),
@ -543,7 +548,7 @@ router.get("/", async (req, res) => {
console.log(`Adding communication for ${sCommTypesById[createCommunicationCommand.typeId]} to ${newMember.firstname} ${newMember.lastname}`)
await CommunicationCommandHandler.create(createCommunicationCommand);
}
}
}
res.sendStatus(200);