Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save subhanahmed047/7751606a30d3cbf16e5bee7e0da95d9f to your computer and use it in GitHub Desktop.
Save subhanahmed047/7751606a30d3cbf16e5bee7e0da95d9f to your computer and use it in GitHub Desktop.
isCodeExist(code: string): Observable<Job[]> {
return <Observable<Job[]>>this.afs
.collection(this.jobsCollection, ref => ref
.where('code', '==', code)
.limit(1)
)
.valueChanges()
.pipe(
flatMap(jobs => jobs),
catchError(err => throwError(err)
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment