Edit Panel UI
This commit is contained in:
parent
bc2fecc50d
commit
7f70ff1c0c
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ const Panel = () => {
|
||||||
if ((val.status == 401 || val.status == 400) && await val.text() == "missing or malformvald JWT") {
|
if ((val.status == 401 || val.status == 400) && await val.text() == "missing or malformvald JWT") {
|
||||||
window.location.href = "/admin/login"
|
window.location.href = "/admin/login"
|
||||||
} else if (val.status == 200) {
|
} else if (val.status == 200) {
|
||||||
setPosts((await val.json() as Array<Object>).map(post => POST.parse(post)))
|
setPosts((await val.json() as Array<Object>).map(post => POST.parse(post)).filter(e => posts.findIndex(x => x.id == e.id) != -1))
|
||||||
}
|
}
|
||||||
}).finally(() => { setLoading(false) })
|
}).finally(() => { setLoading(false) })
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ const Panel = () => {
|
||||||
</div>
|
</div>
|
||||||
<div className="h-full w-full flex flex-col md:flex-row px-10 pt-20">
|
<div className="h-full w-full flex flex-col md:flex-row px-10 pt-20">
|
||||||
<Button onClick={load} disabled={loading}>Load</Button>
|
<Button onClick={load} disabled={loading}>Load</Button>
|
||||||
<Button onClick={Send}>Load</Button>
|
<Button onClick={Send}>Send</Button>
|
||||||
<div className="grid grid-cols-1 md:grid-cols-3 border-3 border-stone-400 rounded w-[80dvw] text-white gap-3 overflow-scroll">
|
<div className="grid grid-cols-1 md:grid-cols-3 border-3 border-stone-400 rounded w-[80dvw] text-white gap-3 overflow-scroll">
|
||||||
{posts.length > 0 ? posts.map(post => {
|
{posts.length > 0 ? posts.map(post => {
|
||||||
return (<div key={post.id} className="border rounded h-fit">
|
return (<div key={post.id} className="border rounded h-fit">
|
||||||
|
|
Loading…
Add table
Reference in a new issue