Skip to content

Commit

Permalink
Merge pull request #90 from OmegaTeamUCAB/new-data
Browse files Browse the repository at this point in the history
New data
  • Loading branch information
cdfornari authored Jul 11, 2024
2 parents caef841 + f201da6 commit 74462f1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions apps/api/src/api.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ export class ApiController {
user: comment.publisher.name,
userId: comment.publisher.id,
userImage: comment.publisher.image,
countLikes: comment.numberOfLikes,
countDislikes: comment.numberOfDislikes,
countLikes: comment.likes.length,
countDislikes: comment.dislikes.length,
userLiked: comment.likes.includes(credentials.userId),
userDisliked: comment.dislikes.includes(credentials.userId),
body: comment.content,
Expand Down Expand Up @@ -384,7 +384,7 @@ export class ApiController {
) {
this.algolia('clickedObjectIDs', {
eventName: 'Course Clicked',
index: 'course',
index: 'courses',
userToken: credentials.userId,
objectIDs: [id],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class GetInstructorByIdQuery {
return {
id: instructor.id,
name: instructor.name,
followers: instructor.followerCount,
followers: instructor.followers.length,
userFollow: instructor.followers.includes(credentials.userId),
location: `${instructor.city}, ${instructor.country}`,
image: instructor.image,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class AlgoliaBlogProjector implements Projector, OnModuleInit {
@InjectModel(MongoBlog.name)
private readonly blogModel: Model<MongoBlog>,
) {
this.index = this.algolia.initIndex('blog');
this.index = this.algolia.initIndex('blogs');
}

private index: SearchIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class AlgoliaCourseProjector
@InjectModel(MongoCourse.name)
private readonly courseModel: Model<MongoCourse>,
) {
this.index = this.algolia.initIndex('course');
this.index = this.algolia.initIndex('courses');
}

private index: SearchIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class AlgoliaEventsProjector implements Projector {
) {
this.algolia('convertedObjectIDs', {
eventName: 'Course Started',
index: 'course',
index: 'courses',
userToken: event.context.user,
objectIDs: [event.dispatcherId],
});
Expand All @@ -41,7 +41,7 @@ export class AlgoliaEventsProjector implements Projector {
) {
this.algolia('convertedObjectIDs', {
eventName: 'Course Watched',
index: 'course',
index: 'courses',
userToken: event.context.user,
objectIDs: [event.dispatcherId],
});
Expand All @@ -54,7 +54,7 @@ export class AlgoliaEventsProjector implements Projector {
) {
this.algolia('convertedObjectIDs', {
eventName: 'Course Completed',
index: 'course',
index: 'courses',
userToken: event.context.user,
objectIDs: [event.dispatcherId],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class GetPopularAlgoliaFacetsService implements Service<DTO, string[]> {
@InjectAlgolia()
private readonly algolia: SearchClient,
) {
this.blogIndex = this.algolia.initIndex('blog');
this.courseIndex = this.algolia.initIndex('course');
this.blogIndex = this.algolia.initIndex('blogs');
this.courseIndex = this.algolia.initIndex('courses');
}

private blogIndex: SearchIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class AlgoliaSearchBlogsService implements Service<SearchDto, Response> {
@InjectAlgolia()
private readonly algolia: SearchClient,
) {
this.index = this.algolia.initIndex('blog');
this.index = this.algolia.initIndex('blogs');
}

private index: SearchIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class AlgoliaSearchCoursesService
@InjectAlgolia()
private readonly algolia: SearchClient,
) {
this.index = this.algolia.initIndex('course');
this.index = this.algolia.initIndex('courses');
}

private index: SearchIndex;
Expand Down

0 comments on commit 74462f1

Please sign in to comment.