mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-23 19:27:51 -04:00
- Add new forms table with type (consent/survey/questionnaire) - Add formResponses table for submissions - Add forms API router with full CRUD: - list, get, create, update, delete - setActive, createVersion - getResponses, submitResponse - Add forms list page with card-based UI - Add form builder with field types (text, textarea, multiple_choice, checkbox, rating, yes_no, date, signature) - Add form viewer with edit mode and preview - Add responses viewing with participant info
52 lines
1.9 KiB
TypeScript
Executable File
52 lines
1.9 KiB
TypeScript
Executable File
import { adminRouter } from "~/server/api/routers/admin";
|
|
import { analyticsRouter } from "~/server/api/routers/analytics";
|
|
import { authRouter } from "~/server/api/routers/auth";
|
|
import { collaborationRouter } from "~/server/api/routers/collaboration";
|
|
import { dashboardRouter } from "~/server/api/routers/dashboard";
|
|
import { experimentsRouter } from "~/server/api/routers/experiments";
|
|
import { filesRouter } from "~/server/api/routers/files";
|
|
import { formsRouter } from "~/server/api/routers/forms";
|
|
import { mediaRouter } from "~/server/api/routers/media";
|
|
import { participantsRouter } from "~/server/api/routers/participants";
|
|
import { pluginsRouter } from "~/server/api/routers/plugins";
|
|
import { studiesRouter } from "~/server/api/routers/studies";
|
|
import { trialsRouter } from "~/server/api/routers/trials";
|
|
import { usersRouter } from "~/server/api/routers/users";
|
|
import { storageRouter } from "~/server/api/routers/storage";
|
|
import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc";
|
|
|
|
/**
|
|
* This is the primary router for your server.
|
|
*
|
|
* All routers added in /api/routers should be manually added here.
|
|
*/
|
|
export const appRouter = createTRPCRouter({
|
|
auth: authRouter,
|
|
users: usersRouter,
|
|
studies: studiesRouter,
|
|
experiments: experimentsRouter,
|
|
participants: participantsRouter,
|
|
trials: trialsRouter,
|
|
files: filesRouter,
|
|
media: mediaRouter,
|
|
plugins: pluginsRouter,
|
|
analytics: analyticsRouter,
|
|
collaboration: collaborationRouter,
|
|
admin: adminRouter,
|
|
dashboard: dashboardRouter,
|
|
storage: storageRouter,
|
|
forms: formsRouter,
|
|
});
|
|
|
|
// export type definition of API
|
|
export type AppRouter = typeof appRouter;
|
|
|
|
/**
|
|
* Create a server-side caller for the tRPC API.
|
|
* @example
|
|
* const trpc = createCaller(createContext);
|
|
* const res = await trpc.post.all();
|
|
* ^? Post[]
|
|
*/
|
|
export const createCaller = createCallerFactory(appRouter);
|