mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-06 02:36:39 +00:00
delete account set profile to inactive
This commit is contained in:
parent
da07929ed3
commit
de6790168c
2 changed files with 9 additions and 2 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ const Dashboard: FC<IProps> = ({
|
|||
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<IProps> = ({
|
|||
</tbody>
|
||||
</table>
|
||||
<div className="my-2">
|
||||
<button className="btn btn-danger" onClick={logout}>
|
||||
<button className="btn btn-danger" onClick={deleteAccount}>
|
||||
<FontAwesomeIcon icon={faUserSlash} /> Delete my Account
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue