litecms 0.2.1 → 0.2.2

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.
package/README.md CHANGED
@@ -1209,7 +1209,7 @@ import { db } from '@/app/db';
1209
1209
  import { blogPosts } from '@/app/db/schema';
1210
1210
  import { eq, and } from 'drizzle-orm';
1211
1211
  import { notFound } from 'next/navigation';
1212
- import ReactMarkdown from 'react-markdown';
1212
+ import ReactMarkdown from 'react-markdown'
1213
1213
  import remarkGfm from 'remark-gfm';
1214
1214
  import { Navigation } from '@/app/components/Navigation';
1215
1215
  import { getNavigation, getSiteSettings } from '@/app/admin/actions';
@@ -1 +1 @@
1
- {"version":3,"file":"CmsBlogAdmin.d.ts","sourceRoot":"","sources":["../../src/admin/CmsBlogAdmin.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACL,CAAC;AAkiCF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EACzB,aAAuC,EACvC,iBAA2B,EAC3B,OAAO,GACV,EAAE,iBAAiB,2CA0MnB"}
1
+ {"version":3,"file":"CmsBlogAdmin.d.ts","sourceRoot":"","sources":["../../src/admin/CmsBlogAdmin.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACL,CAAC;AAkiCF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EACzB,aAAuC,EACvC,iBAA2B,EAC3B,OAAO,GACV,EAAE,iBAAiB,2CA2MnB"}
@@ -1803,12 +1803,13 @@ function CmsBlogAdmin({
1803
1803
  setPosts((prev) => prev.map((p) => p.id === result.post.id ? result.post : p));
1804
1804
  return result.post;
1805
1805
  } else {
1806
+ const newPostId = postData.id ?? generateId();
1806
1807
  const res = await fetch(postsEndpoint, {
1807
1808
  method: "POST",
1808
1809
  headers: { "Content-Type": "application/json" },
1809
1810
  body: JSON.stringify({
1810
- id: generateId(),
1811
- ...postData
1811
+ ...postData,
1812
+ id: newPostId
1812
1813
  })
1813
1814
  });
1814
1815
  if (!res.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litecms",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Timo Weiss",