Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(/recent): add recent reviews view #130

Merged
merged 10 commits into from
Aug 9, 2022
7 changes: 4 additions & 3 deletions firebase/dbOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TPayloadReviews,
TPayloadSemesters,
TPayloadSpecializations,
} from '../globals/types'
} from '@globals/types'
import { parseReviewId } from './utilityFunctions'
import {
addOrUpdateReview,
Expand Down Expand Up @@ -290,8 +290,9 @@ export const getReviews = async (
export const getReviewsRecent50 = async () => {
try {
const snapshot = await getDoc(doc(db, baseDocumentReviewsRecent50))
const recentReviews50 = snapshot.data()
return recentReviews50 ?? null
const data = snapshot.data()
const recentReviews50: Review[] = data ? data?.data : []
return recentReviews50
} catch (e: any) {
console.log(e)
throw new Error(e)
Expand Down
Loading