Admin Panel storage fix
This commit is contained in:
parent
fe119df89f
commit
de231cdf5e
@ -2,7 +2,9 @@
|
||||
"polyfillFiles": [
|
||||
"static/chunks/polyfills.js"
|
||||
],
|
||||
"devFiles": [],
|
||||
"devFiles": [
|
||||
"static/chunks/react-refresh.js"
|
||||
],
|
||||
"ampDevFiles": [],
|
||||
"lowPriorityFiles": [
|
||||
"static/development/_buildManifest.js",
|
||||
@ -10,7 +12,21 @@
|
||||
],
|
||||
"rootMainFiles": [],
|
||||
"pages": {
|
||||
"/_app": []
|
||||
"/_app": [
|
||||
"static/chunks/webpack.js",
|
||||
"static/chunks/main.js",
|
||||
"static/chunks/pages/_app.js"
|
||||
],
|
||||
"/_error": [
|
||||
"static/chunks/webpack.js",
|
||||
"static/chunks/main.js",
|
||||
"static/chunks/pages/_error.js"
|
||||
],
|
||||
"/admin/login": [
|
||||
"static/chunks/webpack.js",
|
||||
"static/chunks/main.js",
|
||||
"static/chunks/pages/admin/login.js"
|
||||
]
|
||||
},
|
||||
"ampFirstPages": []
|
||||
}
|
||||
BIN
.next/cache/webpack/client-development/0.pack.gz
vendored
BIN
.next/cache/webpack/client-development/0.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/client-development/1.pack.gz
vendored
BIN
.next/cache/webpack/client-development/1.pack.gz
vendored
Binary file not shown.
Binary file not shown.
BIN
.next/cache/webpack/server-development/0.pack.gz
vendored
BIN
.next/cache/webpack/server-development/0.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/server-development/1.pack.gz
vendored
BIN
.next/cache/webpack/server-development/1.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/server-development/index.pack.gz
vendored
BIN
.next/cache/webpack/server-development/index.pack.gz
vendored
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":[],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":[],"pages":{"/_app":[]},"ampFirstPages":[]}
|
||||
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":["static/chunks/react-refresh.js"],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":[],"pages":{"/_app":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_app.js"],"/_error":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_error.js"],"/admin/login":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/admin/login.js"]},"ampFirstPages":[]}
|
||||
@ -1,6 +1,25 @@
|
||||
{
|
||||
"sortedMiddleware": [],
|
||||
"middleware": {},
|
||||
"sortedMiddleware": [
|
||||
"/"
|
||||
],
|
||||
"middleware": {
|
||||
"/": {
|
||||
"files": [
|
||||
"server/edge-runtime-webpack.js",
|
||||
"server/middleware.js"
|
||||
],
|
||||
"name": "middleware",
|
||||
"page": "/",
|
||||
"matchers": [
|
||||
{
|
||||
"regexp": "^/.*$",
|
||||
"originalSource": "/:path*"
|
||||
}
|
||||
],
|
||||
"wasm": [],
|
||||
"assets": []
|
||||
}
|
||||
},
|
||||
"functions": {},
|
||||
"version": 2
|
||||
}
|
||||
@ -1 +1,6 @@
|
||||
{}
|
||||
{
|
||||
"/_app": "pages/_app.js",
|
||||
"/_error": "pages/_error.js",
|
||||
"/_document": "pages/_document.js",
|
||||
"/admin/login": "pages/admin/login.js"
|
||||
}
|
||||
@ -1 +1 @@
|
||||
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},sortedPages:["\u002F_app"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
|
||||
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static\u002Fchunks\u002Fpages\u002F_error.js"],"/admin/login":["static\u002Fchunks\u002Fpages\u002Fadmin\u002Flogin.js"],sortedPages:["\u002F_app","\u002F_error","\u002Fadmin\u002Flogin"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
|
||||
File diff suppressed because one or more lines are too long
@ -10,7 +10,6 @@
|
||||
"type": "text",
|
||||
"value": "asdasdasdasdasdasdasd"
|
||||
}
|
||||
],
|
||||
"index": 0
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -14,14 +14,18 @@ export default function AdminPanel() {
|
||||
};
|
||||
|
||||
const handleSave = async (entry, index = null) => {
|
||||
// Entferne das 'index' Feld aus dem Entry bevor es gespeichert wird
|
||||
const cleanEntry = { ...entry };
|
||||
delete cleanEntry.index;
|
||||
|
||||
let updatedEntries;
|
||||
|
||||
if (index !== null) {
|
||||
// Bearbeite bestehenden Eintrag
|
||||
updatedEntries = entries.map((e, i) => i === index ? entry : e);
|
||||
updatedEntries = entries.map((e, i) => i === index ? cleanEntry : e);
|
||||
} else {
|
||||
// Füge neuen Eintrag hinzu
|
||||
updatedEntries = [...entries, entry];
|
||||
updatedEntries = [...entries, cleanEntry];
|
||||
}
|
||||
|
||||
try {
|
||||
@ -169,7 +173,7 @@ export default function AdminPanel() {
|
||||
<p className="text-gray-600">{entry.date}</p>
|
||||
<p className="mb-4">{entry.description}</p>
|
||||
<button
|
||||
onClick={() => setSelectedEntry({ ...entry, index })}
|
||||
onClick={() => setSelectedEntry({ ...entry, editIndex: index })}
|
||||
className="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"
|
||||
>
|
||||
Bearbeiten
|
||||
@ -181,7 +185,7 @@ export default function AdminPanel() {
|
||||
) : (
|
||||
<EntryForm
|
||||
entry={selectedEntry}
|
||||
onSave={(formData) => handleSave(formData, selectedEntry.index)}
|
||||
onSave={(formData) => handleSave(formData, selectedEntry.editIndex)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user