mirror of
https://github.com/Sea-Haven-Industries/google-user-sync.git
synced 2026-05-18 20:20:17 +00:00
Update lambda/index.js
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
parent
5e15036e51
commit
b0e047e5a6
1 changed files with 1 additions and 3 deletions
|
|
@ -148,9 +148,7 @@ function extractUserFields(googleUser) {
|
||||||
if (googleUser.phones && googleUser.phones.length > 0) {
|
if (googleUser.phones && googleUser.phones.length > 0) {
|
||||||
const workPhone = googleUser.phones.find((p) => p.type === "work" && p.value);
|
const workPhone = googleUser.phones.find((p) => p.type === "work" && p.value);
|
||||||
const primaryPhone = googleUser.phones.find((p) => p.primary && p.value) || googleUser.phones.find((p) => p.value);
|
const primaryPhone = googleUser.phones.find((p) => p.primary && p.value) || googleUser.phones.find((p) => p.value);
|
||||||
phone = (workPhone || primaryPhone || {}).value || "";
|
phone = (workPhone && workPhone.value) || primaryPhone.value || "";
|
||||||
}
|
|
||||||
|
|
||||||
return { email, jobTitle, phone };
|
return { email, jobTitle, phone };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue