wasp/examples/tutorials/TodoApp/main.wasp
2020-10-26 23:29:27 +01:00

57 lines
1.1 KiB
JavaScript

app TodoApp {
title: "Todo app"
}
auth {
userEntity: User,
methods: [ EmailAndPassword ]
}
route "/" -> page Main
page Main {
component: import Main from "@ext/MainPage.js"
}
route "/auth" -> page Auth
page Auth {
component: import Auth from "@ext/AuthPage.js"
}
entity User {=psl
id Int @id @default(autoincrement())
email String @unique
password String
tasks Task[]
psl=}
entity Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
user User? @relation(fields: [userId], references: [id])
userId Int?
psl=}
query getTasks {
fn: import { getTasks } from "@ext/queries.js",
entities: [Task]
}
action signUp {
fn: import { signUp } from "@ext/actions.js",
entities: [User]
}
action createTask {
fn: import { createTask } from "@ext/actions.js",
entities: [Task]
}
action updateTask {
fn: import { updateTask } from "@ext/actions.js",
entities: [Task]
}
dependencies {=json
"react-clock": "3.0.0"
json=}