mirror of
https://github.com/jordienr/zenblog.git
synced 2026-09-27 17:45:55 -04:00
fix type errs
This commit is contained in:
@@ -10,6 +10,10 @@ export default async function handler(
|
||||
|
||||
const blogId = req.query.blogId as string;
|
||||
|
||||
if (!user?.id) {
|
||||
return res.status(401).json({ error: "Unauthorized" });
|
||||
}
|
||||
|
||||
if (req.method === "PATCH") {
|
||||
const data = PatchBlog.safeParse(JSON.parse(req.body));
|
||||
|
||||
@@ -23,7 +27,7 @@ export default async function handler(
|
||||
.from("blogs")
|
||||
.update({ title, emoji, description })
|
||||
.eq("id", blogId)
|
||||
.eq("user_id", user?.id)
|
||||
.eq("user_id", user.id)
|
||||
.select()
|
||||
.single();
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ export default async function handler(
|
||||
const { db, user } = await getServerClient(req, res);
|
||||
const blogId = req.query.blogId as string;
|
||||
const postSlug = req.query.postSlug as string;
|
||||
if (!user?.id) {
|
||||
return res.status(401).json({ error: "Unauthorized" });
|
||||
}
|
||||
|
||||
if (req.method === "PATCH") {
|
||||
const data = PatchPost.safeParse(JSON.parse(req.body));
|
||||
|
||||
@@ -25,7 +25,7 @@ export default async function handler(
|
||||
) {
|
||||
const { db } = await getServerClient(req, res);
|
||||
// const { userId } = getAuth(req);
|
||||
const blogId = req.query.blogId;
|
||||
const blogId = req.query.blogId as string;
|
||||
|
||||
if (!db) return res.status(401).json({ error: "Unauthorized" });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user