Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
13 changes: 13 additions & 0 deletions examples/react/start-convex-trellaux/convex/board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T extends { _creationTime: number; _id: Id<any> }>(
doc: T,
) {
Expand Down