Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
cacheComponents: true,
compress: false,
output: "standalone",
images: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(public)/articles/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Comments,
CommentsSkeleton,
} from "@/features/articles/components/article-detail";
import {fetchArticleByUUID} from "@/dal/cacheable/articles";
import {fetchArticleByUUID} from "@/dal/public/articles";

type Props = {
params: Promise<{
Expand Down
4 changes: 1 addition & 3 deletions src/app/(public)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use cache";

import {type Metadata} from "next";
import {FeaturedArticles} from "@/features/home-page/components/featured-articles";
import {fetchHomePageData} from "@/dal/cacheable/home";
import {fetchHomePageData} from "@/dal/public/home";
import Element from "@/features/elements/element";

export const metadata: Metadata = {
Expand Down
8 changes: 0 additions & 8 deletions src/dal/cacheable/articles.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/dal/cacheable/cacheable-dal-driver.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/dal/public/articles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ export async function fetchArticles(config?: AxiosRequestConfig) {
const response = await publicDalDriver.get("articles", config);
return response.data;
}

export async function fetchArticleByUUID(uuid: string) {
const article = await publicDalDriver.get(`articles/${uuid}`);
return article.data;
}
5 changes: 2 additions & 3 deletions src/dal/cacheable/home.ts → src/dal/public/home.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {AxiosRequestConfig} from "axios";
import {cacheableDalDriver} from "./cacheable-dal-driver";
import {publicDalDriver} from "./public-dal-driver";

export async function fetchHomePageData(config?: AxiosRequestConfig) {
const response = await cacheableDalDriver.get("home", config);

const response = await publicDalDriver.get("home", config);
return response.data;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {IconClockHour2, IconInfoCircle} from "@tabler/icons-react";
import {FILES_PUBLIC_URL} from "@/constants/envs";
import {formatDate} from "@/lib/date-and-time";
import classes from "./content.module.css";
import {fetchArticleByUUID} from "@/dal/public/articles";
import {checkBookmarkStatus} from "@/dal/private/bookmarks";
import ArticleTags from "@/features/articles/components/article-tags/ArticleTags";
import {fetchArticleByUUID} from "@/dal/cacheable/articles";

type Props = {
slug: string;
Expand Down
Loading