mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-30 21:27:12 +01:00
asd
This commit is contained in:
@@ -74,7 +74,6 @@ export default function AdminArticlesEditorPage({ params }: { params: { articleI
|
||||
async function updateArticle() {
|
||||
console.log("Update article");
|
||||
const payload: UpdateArticle = {
|
||||
id: params.articleId,
|
||||
title: titleRef.current.value,
|
||||
introduction: introductionRef.current.value,
|
||||
markdown: markdown,
|
||||
@@ -83,7 +82,7 @@ export default function AdminArticlesEditorPage({ params }: { params: { articleI
|
||||
};
|
||||
console.log(payload);
|
||||
|
||||
await fetch("/api/articles/", {
|
||||
await fetch(`/api/articles/${params.articleId.toString()}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
|
||||
@@ -44,7 +44,6 @@ export default function AdminCategoriesEditor({ params }: { params: { categoryId
|
||||
async function updateCategory() {
|
||||
console.log("Update category");
|
||||
const payload: UpdateCategory = {
|
||||
id: params.categoryId,
|
||||
title: titleRef.current.value,
|
||||
color: colorRef.current.value,
|
||||
svg: {
|
||||
@@ -54,7 +53,7 @@ export default function AdminCategoriesEditor({ params }: { params: { categoryId
|
||||
};
|
||||
console.log(payload);
|
||||
|
||||
await fetch("/api/categories/", {
|
||||
await fetch(`/api/categories/${params.categoryId.toString()}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
|
||||
@@ -5,6 +5,8 @@ import Link from "next/link";
|
||||
import Footer from "../components/Footer";
|
||||
import Nav from "../components/Nav";
|
||||
import { FetchManager } from "../manager/fetchManager";
|
||||
import AdminNav from "../components/AdminNav";
|
||||
import AdminControl from "../components/AdminControl";
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
@@ -12,11 +14,10 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
<head></head>
|
||||
|
||||
<body className="body">
|
||||
<div>
|
||||
<Link href={"/admin"}> Admin</Link>
|
||||
</div>
|
||||
<header>
|
||||
<Nav categories={await FetchManager.Category.list()} />
|
||||
<AdminNav />
|
||||
<AdminControl />
|
||||
</header>
|
||||
<main>{children}</main>
|
||||
<Footer />
|
||||
|
||||
Reference in New Issue
Block a user