Skip to content

Commit

Permalink
Fixes headless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Oct 29, 2024
1 parent c8b2120 commit 08304fe
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 78 deletions.
156 changes: 83 additions & 73 deletions waspc/headless-test/examples/todoApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion waspc/headless-test/examples/todoApp/src/auth/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const onBeforeLogin: OnBeforeLoginHook = async ({ providerId }) => {

export const onAfterLogin: OnAfterLoginHook = async ({ prisma, user }) => {
await prisma.user.update({
where: { id: user.id },
where: { id: user!.id },
data: {
isOnAfterLoginHookCalled: true,
},
Expand Down
8 changes: 4 additions & 4 deletions waspc/headless-test/examples/todoApp/src/server/actions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type Task } from "wasp/entities";
import { HttpError } from "wasp/server";
import { type Task } from 'wasp/entities'
import { HttpError } from 'wasp/server'
import {
type CreateTask,
type DeleteCompletedTasks,
type ToggleAllTasks,
type UpdateTaskIsDone,
} from "wasp/server/operations";
} from 'wasp/server/operations'
import { getSomeResource } from './serverSetup.js'

export const createTask: CreateTask<Pick<Task, 'description'>> = async (
Expand Down Expand Up @@ -73,7 +73,7 @@ export const toggleAllTasks: ToggleAllTasks = async (_args, context) => {

const whereIsDone = (isDone: boolean) => ({
isDone,
user: { id: context.user.id },
user: { id: context.user!.id },
})
const Task = context.entities.Task
const notDoneTasksCount = await Task.count({ where: whereIsDone(false) })
Expand Down

0 comments on commit 08304fe

Please sign in to comment.