Skip to content

Commit

Permalink
Add -2 to time setting so to get yesterday date
Browse files Browse the repository at this point in the history
  • Loading branch information
sidiDev committed Dec 18, 2023
1 parent 9190272 commit 9d170f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/api/comment-notification/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import CommentService from '@/utils/supabase/services/comments';
import { createServerClient } from '@/utils/supabase/server';
import moment from 'moment';
import { NextRequest, NextResponse } from 'next/server';
import axios from 'axios';
Expand Down Expand Up @@ -85,7 +84,7 @@ export async function GET(request: NextRequest) {
const commentService = new CommentService(createBrowserClient());
const initCommentLogsService = await commentLogsService();

const dayAgo = moment().add(-1, 'day').toDate();
const dayAgo = moment().add(-2, 'day').toDate();

const groups = await commentService.getCommentsGroupedByProducts(dayAgo);

Expand Down
4 changes: 1 addition & 3 deletions app/api/upvote-notification/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import CommentService from '@/utils/supabase/services/comments';
import { createServerClient } from '@/utils/supabase/server';
import moment from 'moment';
import { NextRequest, NextResponse } from 'next/server';
import axios from 'axios';
Expand Down Expand Up @@ -80,7 +78,7 @@ export async function GET(request: NextRequest) {
const productsService = new ProductsService(createBrowserClient());
const initUpvoteLogsService = await upvoteLogsService();

const dayAgo = moment().add(-1, 'day').toDate();
const dayAgo = moment().add(-2, 'day').toDate();

const groups = await productsService.getUpvotesGroupedByProducts(dayAgo);

Expand Down

0 comments on commit 9d170f2

Please sign in to comment.