fix
All checks were successful
Build And Deploy Main / build-and-deploy (push) Successful in 36s

This commit is contained in:
2026-03-16 16:22:38 -04:00
parent 118c765b61
commit 1500254db7
2 changed files with 33 additions and 2 deletions

View File

@@ -454,16 +454,22 @@ exports.saveExternalUserPermission = async (req, res) => {
external_user_id: externalUserId,
allow_site: allowSite
});
const normalizedTitle = `${title || ""}`.trim();
const payload = {
external_user_id: externalUserId,
allow_site: allowSite,
username,
name,
title,
email,
permissions,
edit_by: editorId
};
if (normalizedTitle) {
payload.title = normalizedTitle;
} else if (existing?.title) {
// Keep existing title when client does not provide one.
payload.title = existing.title;
}
if (!existing) {
payload.create_by = editorId;
}