toggleRole(user.id, user.role === "admin" ? "user" : "admin")
+ },
+ {
+ title: "Delete",
+ onClick: () => deleteUser(user.id)
+ }
+ ]}
+ />
)
}
}
]
return (
-
+
)
}
diff --git a/client/components/file-dropdown/index.tsx b/client/components/file-dropdown/index.tsx
index c90133bd..b9ef188e 100644
--- a/client/components/file-dropdown/index.tsx
+++ b/client/components/file-dropdown/index.tsx
@@ -1,12 +1,12 @@
-import { Button, Link, Text, Popover } from "@geist-ui/core"
-import FileIcon from "@geist-ui/icons/fileText"
-import CodeIcon from "@geist-ui/icons/fileFunction"
-import styles from "./dropdown.module.css"
-import { useCallback, useEffect, useRef, useState } from "react"
-import { codeFileExtensions } from "@lib/constants"
-import ChevronDown from "@geist-ui/icons/chevronDown"
import ShiftBy from "@components/shift-by"
+import { Button, Popover } from "@geist-ui/core"
+import ChevronDown from "@geist-ui/icons/chevronDown"
+import CodeIcon from "@geist-ui/icons/fileFunction"
+import FileIcon from "@geist-ui/icons/fileText"
+import { codeFileExtensions } from "@lib/constants"
import type { File } from "@lib/types"
+import { useCallback, useEffect, useState } from "react"
+import styles from "./dropdown.module.css"
type Item = File & {
icon: JSX.Element
diff --git a/client/components/settings/settings-group/index.tsx b/client/components/settings-group/index.tsx
similarity index 100%
rename from client/components/settings/settings-group/index.tsx
rename to client/components/settings-group/index.tsx
diff --git a/client/components/settings/settings-group/settings-group.module.css b/client/components/settings-group/settings-group.module.css
similarity index 100%
rename from client/components/settings/settings-group/settings-group.module.css
rename to client/components/settings-group/settings-group.module.css
diff --git a/client/components/settings/index.tsx b/client/components/settings/index.tsx
index 802cb1ea..e6ed9215 100644
--- a/client/components/settings/index.tsx
+++ b/client/components/settings/index.tsx
@@ -1,7 +1,6 @@
-import { Fieldset, Text, Divider, Note, Input, Textarea, Button } from "@geist-ui/core"
import Password from "./sections/password"
import Profile from "./sections/profile"
-import SettingsGroup from "./settings-group"
+import SettingsGroup from "../settings-group"
const SettingsPage = () => {
return ( {
}
})
-// admin.delete("/posts/:id", async (req, res, next) => {
-// try {
-// const post = await Post.findByPk(req.params.id)
-// if (!post) {
-// return res.status(404).json({
-// error: "Post not found"
-// })
-// }
-// await post.destroy()
+admin.delete("/posts/:id", async (req, res, next) => {
+ try {
+ const post = await Post.findByPk(req.params.id)
+ if (!post) {
+ return res.status(404).json({
+ error: "Post not found"
+ })
+ }
+ await post.destroy()
-// res.json({
-// success: true
-// })
-// } catch (e) {
-// next(e)
-// }
-// })
+ res.json({
+ success: true
+ })
+ } catch (e) {
+ next(e)
+ }
+})
admin.get("/posts", async (req, res, next) => {
try {