Bug fixes

This commit is contained in:
LittleSheep 2024-01-22 00:42:32 +08:00
parent 16aa7fd215
commit 7e50346d3e
4 changed files with 54 additions and 9 deletions

View File

@ -10,8 +10,8 @@ const { slug } = Astro.params;
const { posts } = ( const { posts } = (
await graphQuery( await graphQuery(
`query Query($where: PostWhereInput!) { `query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) {
posts(where: $where) { posts(where: $where, orderBy: $orderBy) {
slug slug
type type
title title
@ -33,7 +33,14 @@ const { posts } = (
createdAt createdAt
} }
}`, }`,
{ where: { categories: { some: { slug: { equals: slug } } } } } {
orderBy: [
{
createdAt: "desc",
},
],
where: { categories: { some: { slug: { equals: slug } } } },
}
) )
).data; ).data;
--- ---

View File

@ -13,8 +13,8 @@ const { slug } = Astro.params;
const { post } = ( const { post } = (
await graphQuery( await graphQuery(
`query Query($where: PostWhereUniqueInput!) { `query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) {
post(where: $where) { posts(where: $where, orderBy: $orderBy) {
slug slug
type type
title title
@ -43,7 +43,14 @@ const { post } = (
createdAt createdAt
} }
}`, }`,
{ where: { slug } } {
orderBy: [
{
createdAt: "desc",
},
],
where: { slug },
}
) )
).data; ).data;
--- ---

View File

@ -0,0 +1,24 @@
---
import PageLayout from "../../layouts/PageLayout.astro";
---
<PageLayout>
<div role="alert" class="alert alert-info">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="stroke-current shrink-0 w-6 h-6"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
></path></svg
>
<div>
<p>暂无可公开企划,若想进一步探索,可以加入我们的 GoatChat</p>
<a class="link" href="https://matrix.to/#/#plaza:matrix.smartsheep.studio">邀请链接 👈</a>
</div>
</div>
</PageLayout>

View File

@ -10,8 +10,8 @@ const { slug } = Astro.params;
const { posts } = ( const { posts } = (
await graphQuery( await graphQuery(
`query Query($where: PostWhereInput!) { `query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) {
posts(where: $where) { posts(where: $where, orderBy: $orderBy) {
slug slug
type type
title title
@ -33,7 +33,14 @@ const { posts } = (
createdAt createdAt
} }
}`, }`,
{ where: { tags: { some: { slug: { equals: slug } } } } } {
orderBy: [
{
createdAt: "desc",
},
],
where: { tags: { some: { slug: { equals: slug } } } },
}
) )
).data; ).data;
--- ---