wasp/waspc/examples/todoApp/todoApp.wasp

64 lines
1.3 KiB
JavaScript
Raw Normal View History

app todoApp {
title: "ToDo App"
2019-07-04 22:51:05 +03:00
}
entityPSL Project {=psl
id Int @id @default(autoincrement())
name String
2020-09-19 17:11:09 +03:00
// NOTE(matija): not using relations yet.
//tasks Task[]
psl=}
entityPSL Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
2020-09-19 17:11:09 +03:00
// NOTE(matija): not using relations yet.
//project Project @relation(fields: [projectId], references: [id])
//projectId Int
psl=}
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 {
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"
}
query getTasks {
fn: import { getTasks } from "@ext/queries.js"
}
action createTask {
fn: import { createTask } from "@ext/actions.js"
}
action updateTaskIsDone {
fn: import { updateTaskIsDone } from "@ext/actions.js"
}
action deleteCompletedTasks {
fn: import { deleteCompletedTasks } from "@ext/actions.js"
}
action toggleAllTasks {
fn: import { toggleAllTasks } from "@ext/actions.js"
}