mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-22 00:21:43 +03:00
72 lines
1.4 KiB
JavaScript
72 lines
1.4 KiB
JavaScript
app todoApp {
|
|
title: "ToDo App"
|
|
}
|
|
|
|
entityPSL Project {=psl
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
|
|
// NOTE(matija): not using relations yet.
|
|
//tasks Task[]
|
|
psl=}
|
|
|
|
entityPSL Task {=psl
|
|
id Int @id @default(autoincrement())
|
|
description String
|
|
isDone Boolean @default(false)
|
|
|
|
// NOTE(matija): not using relations yet.
|
|
//project Project @relation(fields: [projectId], references: [id])
|
|
//projectId Int
|
|
psl=}
|
|
|
|
route "/" -> page Main
|
|
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"
|
|
}
|
|
|
|
// --------- Queries --------- //
|
|
|
|
query getTasks {
|
|
fn: import { getTasks } from "@ext/queries.js"
|
|
}
|
|
|
|
query getTask {
|
|
fn: import { getTask } from "@ext/queries.js"
|
|
}
|
|
|
|
// --------- Actions --------- //
|
|
|
|
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"
|
|
}
|