-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed buttons, implemented static feed and firestore user registrat…
…ions
- Loading branch information
1 parent
2c1c8c0
commit 26d2c44
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/app/shared/services/firestore/firestore.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { FirestoreService } from './firestore.service'; | ||
|
||
describe('FirestoreService', () => { | ||
let service: FirestoreService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(FirestoreService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Injectable, inject } from '@angular/core'; | ||
import { Firestore, doc, setDoc } from '@angular/fire/firestore'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class FirestoreService { | ||
|
||
private readonly firestore: Firestore = inject(Firestore); | ||
|
||
addUserDetails(userId: string, userDetails: any) { | ||
const userDocRef = doc(this.firestore, `users/${userId}`); | ||
return setDoc(userDocRef, userDetails); | ||
} | ||
} |