generated from nhcarrigan/template
feat: Multiple Features, Accessibility, Security, and UX Improvements #59
@@ -8,6 +8,10 @@ import type {
|
||||
Activity,
|
||||
ActivityFeedResponse,
|
||||
ActivityUser,
|
||||
SuggestionActivity,
|
||||
LikeActivity,
|
||||
CommentActivity,
|
||||
AchievementActivity,
|
||||
} from "@library/shared-types";
|
||||
import { ACHIEVEMENTS, ActivityType } from "@library/shared-types";
|
||||
import { prisma } from "../lib/prisma";
|
||||
@@ -61,7 +65,7 @@ export class ActivityService {
|
||||
limit: number,
|
||||
offset: number,
|
||||
userId?: string
|
||||
) {
|
||||
): Promise<SuggestionActivity[]> {
|
||||
const where = userId
|
||||
? { userId, user: { profilePublic: true, isBanned: false } }
|
||||
: { user: { profilePublic: true, isBanned: false } };
|
||||
@@ -104,7 +108,7 @@ export class ActivityService {
|
||||
limit: number,
|
||||
offset: number,
|
||||
userId?: string
|
||||
) {
|
||||
): Promise<LikeActivity[]> {
|
||||
const where = userId
|
||||
? { userId, user: { profilePublic: true, isBanned: false } }
|
||||
: { user: { profilePublic: true, isBanned: false } };
|
||||
@@ -131,7 +135,7 @@ export class ActivityService {
|
||||
|
||||
// For each like, fetch the entity title
|
||||
const likesWithTitles = await Promise.all(
|
||||
likes.map(async (like) => {
|
||||
likes.map(async (like): Promise<LikeActivity> => {
|
||||
const entityTitle = await this.getEntityTitle(
|
||||
like.entityType,
|
||||
like.entityId
|
||||
@@ -158,7 +162,7 @@ export class ActivityService {
|
||||
limit: number,
|
||||
offset: number,
|
||||
userId?: string
|
||||
) {
|
||||
): Promise<CommentActivity[]> {
|
||||
const where = userId
|
||||
? { userId, user: { profilePublic: true, isBanned: false } }
|
||||
: { user: { profilePublic: true, isBanned: false } };
|
||||
@@ -246,7 +250,7 @@ export class ActivityService {
|
||||
limit: number,
|
||||
offset: number,
|
||||
userId?: string
|
||||
) {
|
||||
): Promise<AchievementActivity[]> {
|
||||
const where = userId
|
||||
? {
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user