Upsert (Update or Insert) Person Record #53
Labels
enhancement
New feature or enhancement of existing functionality
starter
A beginner-friendly issue that is a good starting point for a new person
T1h
Time Estimate 1 Hour
technical
A technical issue that requires understanding of the code, infrastructure or dependencies
At present we are inserting an initial person into
people
inseeds.exs
based on theADMIN_EMAIL
environment variable. This person is the (first) "admin" of the auth app.They will have full control over the auth app. The issue is that we don't want to hard-code too much data into the
seed.exs
and we don't want to have 5 environment variables for defining the Admin person.So when the Admin logs into the App for the first time, they see this:
When it should show this:
We need to update the person record for the Admin when they successfully login with their Google Account.
With that in mind we need an
upsert_person/1
function.This will be useful for anyone who updates their Google/GitHub profile e.g: their profile picture and wants that change to flow through to their @dwyl profile.
# Todo
upsert_person/1
function that accepts aperson
record and either creates a new record if one does not already exist or updates the existing record with the new values.The text was updated successfully, but these errors were encountered: