diff --git a/examples/react/start-convex-trellaux/convex/_generated/api.d.ts b/examples/react/start-convex-trellaux/convex/_generated/api.d.ts index 33b400c939..b565b5276d 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/api.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/api.d.ts @@ -16,6 +16,7 @@ import type { FunctionReference, } from 'convex/server' import type * as board from '../board.js' +import type * as crons from '../crons.js' /** * A utility for referencing Convex functions in your app's API. @@ -27,6 +28,7 @@ import type * as board from '../board.js' */ declare const fullApi: ApiFromModules<{ board: typeof board + crons: typeof crons }> export declare const api: FilterApi< typeof fullApi, diff --git a/examples/react/start-convex-trellaux/convex/board.ts b/examples/react/start-convex-trellaux/convex/board.ts index 48217eb13b..91fce9a1ef 100644 --- a/examples/react/start-convex-trellaux/convex/board.ts +++ b/examples/react/start-convex-trellaux/convex/board.ts @@ -27,6 +27,19 @@ export const seed = internalMutation(async (ctx) => { }) }) +// Clear all boards (do this on a regular cadence for public examples) +export const clear = internalMutation(async (ctx) => { + const allBoards = await ctx.db.query('boards').collect() + for (const board of allBoards) { + await ctx.db.delete(board._id) + } + await ctx.db.insert('boards', { + id: '1', + name: 'First board', + color: '#e0e0e0', + }) +}) + function withoutSystemFields }>( doc: T, ) {