Skip to content

Commit c1b7fd2

Browse files
authored
Merge pull request #21 from techdiary-dev/series-article
typo fix
2 parents 03ac2b7 + b239388 commit c1b7fd2

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/.pnp
66
.pnp.js
77
yarn.lock
8+
pnpm-lock.yaml
89
.yarn/cache
910
bun.lockb
1011
.yarn/install-state.gz

.vscode/launch.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Next.js: debug server-side",
6+
"type": "node-terminal",
7+
"request": "launch",
8+
"command": "npm run dev",
9+
"skipFiles": ["<node_internals>/**"],
10+
"serverReadyAction": {
11+
"pattern": "started server on .+, url: (https?://.+)",
12+
"uriFormat": "%s",
13+
"action": "openExternally"
14+
}
15+
},
16+
{
17+
"name": "Next.js: debug client-side",
18+
"type": "chrome",
19+
"request": "launch",
20+
"url": "http://localhost:3000",
21+
"webRoot": "${workspaceFolder}"
22+
},
23+
{
24+
"name": "Next.js: debug full stack",
25+
"type": "node-terminal",
26+
"request": "launch",
27+
"command": "npm run dev",
28+
"serverReadyAction": {
29+
"pattern": "started server on .+, url: (https?://.+)",
30+
"uriFormat": "%s",
31+
"action": "debugWithChrome"
32+
}
33+
}
34+
]
35+
}

src/app/(home)/_components/ArticleFeed.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import * as articleActions from "@/backend/services/article.actions";
44
import ArticleCard from "@/components/ArticleCard";
5+
import VisibilitySensor from "@/components/VisibilitySensor";
56
import { readingTime } from "@/lib/utils";
67
import getFileUrl from "@/utils/getFileUrl";
78
import { useInfiniteQuery } from "@tanstack/react-query";
8-
import VisibilitySensor from "@/components/VisibilitySensor";
99

1010
const ArticleFeed = () => {
1111
const feedInfiniteQuery = useInfiniteQuery({
@@ -14,6 +14,7 @@ const ArticleFeed = () => {
1414
articleActions.articleFeed({ limit: 5, page: pageParam }),
1515
initialPageParam: 1,
1616
getNextPageParam: (lastPage) => {
17+
if (!lastPage?.meta.hasNextPage) return undefined;
1718
const _page = lastPage?.meta?.currentPage ?? 1;
1819
return _page + 1;
1920
},

src/backend/services/article.actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use server";
22

3-
import { generateRandomString, removeMarkdownSyntax } from "@/lib/utils";
3+
import { slugify } from "@/lib/slug-helper.util";
4+
import { removeMarkdownSyntax } from "@/lib/utils";
45
import { z } from "zod";
56
import { Article, User } from "../models/domain-models";
67
import { pgClient } from "../persistence/database-drivers/pg.client";
@@ -18,7 +19,6 @@ import {
1819
} from "./RepositoryException";
1920
import { ArticleRepositoryInput } from "./inputs/article.input";
2021
import { getSessionUserId } from "./session.actions";
21-
import { slugify } from "@/lib/slug-helper.util";
2222

2323
const articleRepository = new PersistentRepository<Article>(
2424
"articles",

0 commit comments

Comments
 (0)