Skip to content

Commit

Permalink
changed buttons, implemented static feed and firestore user registrat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
Gururajj77 committed Jan 11, 2024
1 parent 2c1c8c0 commit 26d2c44
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/app/shared/services/firestore/firestore.service.spec.ts
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();
});
});
15 changes: 15 additions & 0 deletions src/app/shared/services/firestore/firestore.service.ts
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);
}
}

0 comments on commit 26d2c44

Please sign in to comment.