Skip to content

Commit

Permalink
chore(up): update module ; improve prompts handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Nov 13, 2023
1 parent 9b7da2b commit a2cc6ba
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 94 deletions.
4 changes: 2 additions & 2 deletions playground/dbschema/default.esdl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ module default {

type BlogPost {
property content: str {
default := 'My blog post content.';
default := 'My super blog post.';
};
property description: str {
default := 'My blog post description.';
};
property title: str {
default := 'My blog post';
default := 'My blog super blog post title.';
};
required author: User {
default := global current_user;
Expand Down
5 changes: 4 additions & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ export default defineNuxtConfig({
auth: true,
oauth: true
},
devtools: { enabled: true }
devtools: { enabled: true },
tailwindcss: {
viewer: false
}
})
12 changes: 1 addition & 11 deletions playground/server/api/blogpost/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { defineEventHandler, isMethod, readBody } from 'h3'

export default defineEventHandler(async (req) => {
if (isMethod(req, 'DELETE')) {
const { id } = await readBody(req)

const { deleteBlogPost } = useEdgeDbQueries(req)

return await deleteBlogPost({ blogpost_id: id })
}
if (isMethod(req, 'POST')) {
const {
title,
Expand All @@ -21,12 +14,9 @@ export default defineEventHandler(async (req) => {
blogpost_title: title,
blogpost_description: description,
blogpost_content: content,

})

return blogPost
}

const { allBlogPosts } = useEdgeDbQueries()

return await allBlogPosts()
})
5 changes: 4 additions & 1 deletion playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "./.nuxt/tsconfig.json"
"extends": "./.nuxt/tsconfig.json",
"vueCompilerOptions": {
"skipTemplateCodegen": true
}
}
Loading

0 comments on commit a2cc6ba

Please sign in to comment.