Skip to content

Commit

Permalink
fix remote db bug
Browse files Browse the repository at this point in the history
  • Loading branch information
spcbfr committed Mar 25, 2024
1 parent 36d66a0 commit a1d9059
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"build": "astro check && astro build --remote",
"preview": "astro preview",
"astro": "astro"
},
Expand Down
17 changes: 17 additions & 0 deletions src/pages/notes/[...slug].astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import { eq } from "astro:db";
import { db, Note } from "astro:db";
const { slug } = Astro.params;
const date = new Date(0);
date.setUTCSeconds(Number(slug));
const note = await db
.select()
.from(Note)
.where(eq(Note.published, date))
.limit(1);
---

{note[0].content}

0 comments on commit a1d9059

Please sign in to comment.