Skip to content

Commit

Permalink
fix(handle-callback): preset 'updated_at' on firestore coll
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Feb 15, 2020
1 parent 6bd809e commit 9579f7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/methods/handle-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ const handleCallback = client => {

// insert application with respective authentication data
if (collRef) {
const firestoreTimestamp = admin.firestore.Timestamp.fromDate(new Date())
firestoreDoc = {
application_id: application._id,
application_app_id: application.app_id,
application_title: application.title,
authentication_id: authenticationId,
authentication_permissions: JSON.stringify(authentication.permissions),
store_id: storeId,
created_at: admin.firestore.Timestamp.fromDate(new Date()),
updated_at: null
created_at: firestoreTimestamp,
updated_at: firestoreTimestamp
}
} else {
values = [
Expand Down

0 comments on commit 9579f7e

Please sign in to comment.