wasp/waspc/examples/todoApp/todoApp.wasp

95 lines
1.8 KiB
JavaScript
Raw Normal View History

app todoApp {
title: "ToDo App"
2019-07-04 22:51:05 +03:00
}
2020-10-19 15:45:54 +03:00
auth {
userEntity: User,
methods: [ EmailAndPassword ]
}
entityPSL User {=psl
id Int @id @default(autoincrement())
email String @unique
password String
tasks Task[]
psl=}
entityPSL Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
user User @relation(fields: [userId], references: [id])
userId Int
psl=}
2020-10-19 15:45:54 +03:00
route "/login" -> page Login
page Login {
component: import Login from "@ext/pages/Login"
}
route "/signup" -> page Signup
page Signup {
component: import Signup from "@ext/pages/Signup"
}
route "/" -> page Main
2019-07-04 22:51:05 +03:00
page Main {
component: import Main from "@ext/pages/Main"
}
route "/about" -> page About
page About {
component: import About from "@ext/pages/About"
}
route "/profile" -> page Profile
page Profile {
2020-10-15 22:02:05 +03:00
component: import { ProfilePage } from "@ext/pages/ProfilePage"
}
// Page for viewing a specific task
//
route "/task/:id" -> page Task
page Task {
component: import Task from "@ext/pages/Task"
}
// --------- Queries --------- //
query getTasks {
fn: import { getTasks } from "@ext/queries.js",
entities: [Task]
}
query getTask {
2020-10-19 15:45:54 +03:00
fn: import { getTask } from "@ext/queries.js",
entities: [Task]
}
// --------- Actions --------- //
2020-10-19 15:45:54 +03:00
action signUp {
fn: import { signUp } from "@ext/actions.js",
entities: [User]
}
action createTask {
fn: import { createTask } from "@ext/actions.js",
entities: [Task]
}
action updateTaskIsDone {
fn: import { updateTaskIsDone } from "@ext/actions.js",
entities: [Task]
}
action deleteCompletedTasks {
fn: import { deleteCompletedTasks } from "@ext/actions.js",
entities: [Task]
}
action toggleAllTasks {
fn: import { toggleAllTasks } from "@ext/actions.js",
entities: [Task]
}