@yimingliao/cms 0.0.72 → 0.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1811,19 +1811,21 @@ function createPostQueryRepository(prisma) {
1811
1811
  const where = buildWhere3(rest);
1812
1812
  if (!where) return { post: void 0, prev: void 0, next: void 0 };
1813
1813
  const baseWhere = {
1814
- ...where,
1815
1814
  // states
1816
1815
  ...isActive ? { isActive } : {},
1817
1816
  // relations
1818
1817
  ...topicSlug ? { topic: { slug: topicSlug } } : {}
1819
1818
  };
1820
1819
  const post = await prisma.post.findFirst({
1821
- where: baseWhere,
1820
+ where: { ...baseWhere, ...where },
1822
1821
  include: POST_FULL_INCLUDE
1823
1822
  });
1824
1823
  if (!post) return { post: void 0, prev: void 0, next: void 0 };
1825
1824
  const next = await prisma.post.findFirst({
1826
- where: baseWhere,
1825
+ where: {
1826
+ ...baseWhere,
1827
+ ...rest.type !== void 0 ? { type: rest.type } : {}
1828
+ },
1827
1829
  orderBy: POST_ORDER_BY,
1828
1830
  cursor: { id: post.id },
1829
1831
  skip: 1,
@@ -1835,7 +1837,10 @@ function createPostQueryRepository(prisma) {
1835
1837
  return { [key]: o[key] === "asc" ? "desc" : "asc" };
1836
1838
  });
1837
1839
  const prev = await prisma.post.findFirst({
1838
- where: baseWhere,
1840
+ where: {
1841
+ ...baseWhere,
1842
+ ...rest.type !== void 0 ? { type: rest.type } : {}
1843
+ },
1839
1844
  orderBy: reversedOrder,
1840
1845
  cursor: { id: post.id },
1841
1846
  skip: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",