From de6790168c8ca53cc1f5b62432ef77220fbce6ea Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Sat, 16 May 2020 12:18:25 +0200 Subject: [PATCH] delete account set profile to inactive --- src/models/Dev.ts | 3 +++ src/pages/Dashboard.tsx | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/models/Dev.ts b/src/models/Dev.ts index 6bddd26..759112c 100644 --- a/src/models/Dev.ts +++ b/src/models/Dev.ts @@ -17,6 +17,7 @@ export interface DevSummary { * @extends DevSummary to avoid duplication */ interface Dev extends DevSummary { + isActive: boolean; bio: string; status: string; company: string; @@ -33,6 +34,7 @@ export const getDescription = (status: string, company: string) => /** blank Dev serve as placeholder when initializing a new profile */ export const blankDev: Dev = { id: '42', + isActive: true, displayName: '', status: 'Developer', company: '', @@ -60,6 +62,7 @@ export const blankDev: Dev = { */ export const dummyDev: Dev = { id: '0', + isActive: true, displayName: 'John Doe', status: 'Developer', company: 'Microsoft', diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 4332655..ddbf17b 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -31,7 +31,11 @@ const Dashboard: FC = ({ experiences, educations, }) => { - const logout = () => firebase.logout(); + /** turns account to inactive then logs user out */ + const deleteAccount = () => { + firebase.updateProfile({isActive: false}, {useSet: true, merge: true}); + firebase.logout(); + }; /** * @@ -131,7 +135,7 @@ const Dashboard: FC = ({
-