WaspW
Wasp15mo ago
NEROX

- SDK build failed with exit code: 2

Heyy @kapa.ai I need your wisdom here





[ Wasp ] ext-src/dashboard/exercises/ExerciseForm.tsx(22,58): error TS2345: Argument of type 'GetBodyParts' is not assignable to parameter of type 'Query<never, Payload>'. [ Wasp ] Type 'GetBodyParts' is not assignable to type '(args?: unknown) => Promise<Payload>'. [ Wasp ] Target signature provides too few arguments. Expected 2 or more, but got 1. [ Wasp ] ext-src/dashboard/exercises/ExerciseForm.tsx(23,32): error TS2304: Cannot find name 'useAction'.

//@src/dashboard/bodyparts/BodyPartQueries.ts import { GetBodyParts, GetBodyPartById } from 'wasp/server/operations'; export const getBodyParts: GetBodyParts = async (args, context) => { return context.entities.BodyPart.findMany(); }; export const getBodyPartById: GetBodyPartById = async ({ id }, context) => { const bodyPart = await context.entities.BodyPart.findUnique({ where: { id }, include: { exercises: true } }); if (!bodyPart) { throw new Error('BodyPart not found'); } return bodyPart; };

//@src/dashboard/exercises/ExerciseActions.ts import { CreateExercise, UpdateExercise, DeleteExercise } from 'wasp/server/operations'; export const createExercise: CreateExercise = async ({ name, instructions, difficulty, equipmentRequired, equipment, bodyPartId }, context) => { return context.entities.Exercise.create({ data: { name, instructions, difficulty, equipmentRequired, equipment, bodyPart: { connect: { id: bodyPartId } } } }); }; export const updateExercise: UpdateExercise = async ({ id, name, instructions, difficulty, equipmentRequired, equipment, bodyPartId }, context) => { return context.entities.Exercise.update({ where: { id }, data: { name, instructions, difficulty, equipmentRequired, equipment, bodyPart: { connect: { id: bodyPartId } } } }); }; export const deleteExercise: DeleteExercise = async ({ id }, context) => { const exercise = await context.entities.Exercise.findUnique({ where: { id } }); if (!exercise) { throw new Error('Exercise not found'); } return context.entities.Exercise.delete({ where: { id } }); };


What and where is going something wrong?
Was this page helpful?