mirror of
https://github.com/jordienr/zenblog.git
synced 2026-09-27 17:45:55 -04:00
wip
This commit is contained in:
@@ -34,8 +34,10 @@ const handler = createNextHandler(
|
||||
const limit = query.limit || 30;
|
||||
|
||||
const posts = await supabase
|
||||
.from("posts")
|
||||
.select("title, published_at, created_at, slug, cover_image")
|
||||
.from("posts_v5")
|
||||
.select(
|
||||
"title, published_at, created_at, slug, cover_image, category_name, category_slug"
|
||||
)
|
||||
.eq("deleted", false)
|
||||
.eq("published", true)
|
||||
.eq("blog_id", blog.id)
|
||||
@@ -51,6 +53,7 @@ const handler = createNextHandler(
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("🟢 Posts:", posts.data[0].category_name);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
|
||||
@@ -31,6 +31,14 @@ const BasePostSchema = z.object({
|
||||
title: z
|
||||
.string()
|
||||
.openapi({ description: "The title of the post", example: "Hello World!" }),
|
||||
category_name: z.string().nullable().openapi({
|
||||
description: "The name of the category",
|
||||
example: "Tutorials",
|
||||
}),
|
||||
category_slug: z.string().nullable().openapi({
|
||||
description: "The slug of the category",
|
||||
example: "tutorials",
|
||||
}),
|
||||
});
|
||||
|
||||
const GetPostsSchema = BasePostSchema;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "api-deprecated",
|
||||
"name": "api",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -5,10 +5,9 @@ import { motion } from "framer-motion";
|
||||
import Notifications from "@/components/Notifications";
|
||||
import Feedback from "@/components/Feedback";
|
||||
import Footer from "@/components/Footer";
|
||||
import { useIsSubscribed, usePlan } from "@/queries/subscription";
|
||||
import { usePlan } from "@/queries/subscription";
|
||||
import AppChecks from "@/components/LoggedInUserChecks";
|
||||
import { Loader } from "lucide-react";
|
||||
import { HiOutlineInformationCircle } from "react-icons/hi";
|
||||
import { useUser } from "@/utils/supabase/browser";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
- [] Add tags to posts API
|
||||
- [] Fix deleting tags with posts
|
||||
- [] Use a JWT with the blog id to authenticate the API, should make api faster by removing one req to get the blog id
|
||||
- [] Add tags to posts API
|
||||
- [] Add categories to posts API
|
||||
- [] fix creating tags in tags tab
|
||||
- [] fix metadata format so that its {key:value} not [{key:foo,value:bar}]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user