2022-12-20 13:30:00 +03:00
|
|
|
app TodoTypescript {
|
2022-12-20 13:11:13 +03:00
|
|
|
wasp: {
|
2024-10-04 14:53:34 +03:00
|
|
|
version: "^0.15.0"
|
2022-12-20 13:11:13 +03:00
|
|
|
},
|
|
|
|
title: "ToDo TypeScript",
|
|
|
|
|
|
|
|
auth: {
|
|
|
|
userEntity: User,
|
|
|
|
methods: {
|
2023-10-12 16:31:27 +03:00
|
|
|
usernameAndPassword: {}, // this is a very naive implementation, use 'email' in production instead
|
|
|
|
//google: {}, //https://wasp-lang.dev/docs/integrations/google
|
|
|
|
//gitHub: {}, //https://wasp-lang.dev/docs/integrations/github
|
|
|
|
//email: {} //https://wasp-lang.dev/docs/guides/email-auth
|
2022-12-20 13:11:13 +03:00
|
|
|
},
|
|
|
|
onAuthFailedRedirectTo: "/login",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
route RootRoute { path: "/", to: MainPage }
|
|
|
|
page MainPage {
|
|
|
|
authRequired: true,
|
2024-07-08 19:01:46 +03:00
|
|
|
component: import { MainPage } from "@src/MainPage.tsx"
|
2022-12-20 13:11:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
route LoginRoute { path: "/login", to: LoginPage }
|
|
|
|
page LoginPage {
|
2024-07-08 19:01:46 +03:00
|
|
|
component: import { LoginPage } from "@src/LoginPage.tsx"
|
2022-12-20 13:11:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
route SignupRoute { path: "/signup", to: SignupPage }
|
|
|
|
page SignupPage {
|
2024-07-08 19:01:46 +03:00
|
|
|
component: import { SignupPage } from "@src/SignupPage.tsx"
|
2022-12-20 13:11:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
query getTasks {
|
|
|
|
// We specify the JS implementation of our query (which is an async JS function)
|
2023-03-01 19:14:14 +03:00
|
|
|
// Even if you use TS and have a queries.ts file, you will still need to import it using the .js extension.
|
2022-12-20 13:37:22 +03:00
|
|
|
// see here for more info: https://wasp-lang.dev/docs/tutorials/todo-app/03-listing-tasks#wasp-declaration
|
2024-07-08 19:01:46 +03:00
|
|
|
fn: import { getTasks } from "@src/queries.js",
|
2022-12-20 13:11:13 +03:00
|
|
|
// We tell Wasp that this query is doing something with the `Task` entity. With that, Wasp will
|
|
|
|
// automatically refresh the results of this query when tasks change.
|
|
|
|
entities: [Task]
|
|
|
|
}
|
|
|
|
|
|
|
|
action createTask {
|
2024-07-08 19:01:46 +03:00
|
|
|
fn: import { createTask } from "@src/actions.js",
|
2022-12-20 13:11:13 +03:00
|
|
|
entities: [Task]
|
|
|
|
}
|
|
|
|
|
|
|
|
action updateTask {
|
2024-07-08 19:01:46 +03:00
|
|
|
fn: import { updateTask } from "@src/actions.js",
|
2022-12-20 13:11:13 +03:00
|
|
|
entities: [Task]
|
|
|
|
}
|
2023-10-12 16:31:27 +03:00
|
|
|
|
|
|
|
action deleteTasks {
|
2024-07-08 19:01:46 +03:00
|
|
|
fn: import { deleteTasks } from "@src/actions.js",
|
2023-10-12 16:31:27 +03:00
|
|
|
entities: [Task],
|
|
|
|
}
|