Skip to content

Commit

Permalink
docs: add TODO and FIXME tags
Browse files Browse the repository at this point in the history
  • Loading branch information
banushi-a committed Mar 26, 2024
1 parent 29065e9 commit 1d310cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/app/roles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { api } from "~/trpc/server";
import { unstable_noStore as noStore } from "next/cache";

export default async function Roles() {
/**
* FIXME: This is a temporary fix, figure out how to get build command working without noStore();
* @returns A promise containing the roles from the database
*/
async function getRoles() {
noStore();
const roles = await api.role.list.query();
Expand Down
9 changes: 5 additions & 4 deletions src/components/role-review-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ export async function RoleReviewCard({
roleObj,
...props
}: RoleReviewCardProps) {
// Get all of the information needed from the corresponding company
// ===== COMPANY DATA ===== //
const company = await api.company.getById.query({ id: roleObj.companyId });
const roleDescription =
roleObj.description && roleObj.description.length >= 210
? cn(roleObj.description.slice(0, 210), "...")
: roleObj.description;
const positionDate: string = formatDate(company.createdAt);

// Get all of the information needed from the corresponding reviews
// ===== REVIEW DATA ===== //
const reviews = await api.review.getByRole.query({ roleId: roleObj.id });
const reviewCount = reviews.length;
let workEnvironment = "In Person";
Expand All @@ -77,8 +77,9 @@ export async function RoleReviewCard({
workEnvironment = "Remote";
}
}
// Calculate average total review
// TODO: abstract?

// ===== AVERAGE RATING ===== //
// TODO: Abstract?
const totalStars = reviews.reduce((accum, curr) => {
return accum + curr.overallRating;
}, 0);
Expand Down

0 comments on commit 1d310cb

Please sign in to comment.