From 396777ba4494ee52a06b90bacdb68d51a141a87b Mon Sep 17 00:00:00 2001 From: Tom Ballinger Date: Mon, 21 Oct 2024 15:48:18 -0700 Subject: [PATCH 1/2] examples: add a periodic clear function to Convex backend --- .../convex/_generated/api.d.ts | 18 ++++++------ .../convex/_generated/api.js | 6 ++-- .../convex/_generated/dataModel.d.ts | 14 +++++----- .../convex/_generated/server.d.ts | 28 +++++++++---------- .../convex/_generated/server.js | 16 +++++------ .../start-convex-trellaux/convex/board.ts | 13 +++++++++ 6 files changed, 55 insertions(+), 40 deletions(-) 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..85c98ae192 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/api.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/api.d.ts @@ -14,8 +14,9 @@ import type { ApiFromModules, FilterApi, FunctionReference, -} from 'convex/server' -import type * as board from '../board.js' +} 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. @@ -26,15 +27,16 @@ import type * as board from '../board.js' * ``` */ declare const fullApi: ApiFromModules<{ - board: typeof board -}> + board: typeof board; + crons: typeof crons; +}>; export declare const api: FilterApi< typeof fullApi, - FunctionReference -> + FunctionReference +>; export declare const internal: FilterApi< typeof fullApi, - FunctionReference -> + FunctionReference +>; /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/api.js b/examples/react/start-convex-trellaux/convex/_generated/api.js index f5eb6204e5..b5f2e089da 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/api.js +++ b/examples/react/start-convex-trellaux/convex/_generated/api.js @@ -10,7 +10,7 @@ * @module */ -import { anyApi } from 'convex/server' +import { anyApi } from "convex/server"; /** * A utility for referencing Convex functions in your app's API. @@ -20,7 +20,7 @@ import { anyApi } from 'convex/server' * const myFunctionReference = api.myModule.myFunction; * ``` */ -export const api = anyApi -export const internal = anyApi +export const api = anyApi; +export const internal = anyApi; /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts b/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts index 45f90d64e3..91445dfc70 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts @@ -15,14 +15,14 @@ import type { DocumentByName, TableNamesInDataModel, SystemTableNames, -} from 'convex/server' -import type { GenericId } from 'convex/values' -import schema from '../schema.js' +} from "convex/server"; +import type { GenericId } from "convex/values"; +import schema from "../schema.js"; /** * The names of all of your Convex tables. */ -export type TableNames = TableNamesInDataModel +export type TableNames = TableNamesInDataModel; /** * The type of a document stored in Convex. @@ -32,7 +32,7 @@ export type TableNames = TableNamesInDataModel export type Doc = DocumentByName< DataModel, TableName -> +>; /** * An identifier for a document in Convex. @@ -48,7 +48,7 @@ export type Doc = DocumentByName< * @typeParam TableName - A string literal type of the table name (like "users"). */ export type Id = - GenericId + GenericId; /** * A type describing your Convex data model. @@ -59,6 +59,6 @@ export type Id = * This type is used to parameterize methods like `queryGeneric` and * `mutationGeneric` to make them type-safe. */ -export type DataModel = DataModelFromSchemaDefinition +export type DataModel = DataModelFromSchemaDefinition; /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/server.d.ts b/examples/react/start-convex-trellaux/convex/_generated/server.d.ts index ffdf9e04e9..8190e1ff37 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/server.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/server.d.ts @@ -20,8 +20,8 @@ import { GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter, -} from 'convex/server' -import type { DataModel } from './dataModel.js' +} from "convex/server"; +import type { DataModel } from "./dataModel.js"; /** * Define a query in this Convex app's public API. @@ -31,7 +31,7 @@ import type { DataModel } from './dataModel.js' * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const query: QueryBuilder +export declare const query: QueryBuilder; /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -41,7 +41,7 @@ export declare const query: QueryBuilder * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const internalQuery: QueryBuilder +export declare const internalQuery: QueryBuilder; /** * Define a mutation in this Convex app's public API. @@ -51,7 +51,7 @@ export declare const internalQuery: QueryBuilder * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const mutation: MutationBuilder +export declare const mutation: MutationBuilder; /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -61,7 +61,7 @@ export declare const mutation: MutationBuilder * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const internalMutation: MutationBuilder +export declare const internalMutation: MutationBuilder; /** * Define an action in this Convex app's public API. @@ -74,7 +74,7 @@ export declare const internalMutation: MutationBuilder * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export declare const action: ActionBuilder +export declare const action: ActionBuilder; /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -82,7 +82,7 @@ export declare const action: ActionBuilder * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export declare const internalAction: ActionBuilder +export declare const internalAction: ActionBuilder; /** * Define an HTTP action. @@ -94,7 +94,7 @@ export declare const internalAction: ActionBuilder * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. */ -export declare const httpAction: HttpActionBuilder +export declare const httpAction: HttpActionBuilder; /** * A set of services for use within Convex query functions. @@ -105,7 +105,7 @@ export declare const httpAction: HttpActionBuilder * This differs from the {@link MutationCtx} because all of the services are * read-only. */ -export type QueryCtx = GenericQueryCtx +export type QueryCtx = GenericQueryCtx; /** * A set of services for use within Convex mutation functions. @@ -113,7 +113,7 @@ export type QueryCtx = GenericQueryCtx * The mutation context is passed as the first argument to any Convex mutation * function run on the server. */ -export type MutationCtx = GenericMutationCtx +export type MutationCtx = GenericMutationCtx; /** * A set of services for use within Convex action functions. @@ -121,7 +121,7 @@ export type MutationCtx = GenericMutationCtx * The action context is passed as the first argument to any Convex action * function run on the server. */ -export type ActionCtx = GenericActionCtx +export type ActionCtx = GenericActionCtx; /** * An interface to read from the database within Convex query functions. @@ -130,7 +130,7 @@ export type ActionCtx = GenericActionCtx * document by its {@link Id}, or {@link DatabaseReader.query}, which starts * building a query. */ -export type DatabaseReader = GenericDatabaseReader +export type DatabaseReader = GenericDatabaseReader; /** * An interface to read from and write to the database within Convex mutation @@ -141,6 +141,6 @@ export type DatabaseReader = GenericDatabaseReader * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control) * for the guarantees Convex provides your functions. */ -export type DatabaseWriter = GenericDatabaseWriter +export type DatabaseWriter = GenericDatabaseWriter; /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/server.js b/examples/react/start-convex-trellaux/convex/_generated/server.js index a557aec2c8..33b487cd24 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/server.js +++ b/examples/react/start-convex-trellaux/convex/_generated/server.js @@ -18,7 +18,7 @@ import { internalActionGeneric, internalMutationGeneric, internalQueryGeneric, -} from 'convex/server' +} from "convex/server"; /** * Define a query in this Convex app's public API. @@ -28,7 +28,7 @@ import { * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export const query = queryGeneric +export const query = queryGeneric; /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -38,7 +38,7 @@ export const query = queryGeneric * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export const internalQuery = internalQueryGeneric +export const internalQuery = internalQueryGeneric; /** * Define a mutation in this Convex app's public API. @@ -48,7 +48,7 @@ export const internalQuery = internalQueryGeneric * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export const mutation = mutationGeneric +export const mutation = mutationGeneric; /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -58,7 +58,7 @@ export const mutation = mutationGeneric * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export const internalMutation = internalMutationGeneric +export const internalMutation = internalMutationGeneric; /** * Define an action in this Convex app's public API. @@ -71,7 +71,7 @@ export const internalMutation = internalMutationGeneric * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export const action = actionGeneric +export const action = actionGeneric; /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -79,7 +79,7 @@ export const action = actionGeneric * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export const internalAction = internalActionGeneric +export const internalAction = internalActionGeneric; /** * Define a Convex HTTP action. @@ -88,6 +88,6 @@ export const internalAction = internalActionGeneric * as its second. * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`. */ -export const httpAction = httpActionGeneric +export const httpAction = httpActionGeneric; /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/board.ts b/examples/react/start-convex-trellaux/convex/board.ts index 48217eb13b..219d539de3 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, ) { From c87aa2cc5748f876b42783d0e665f1688289b671 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:50:47 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- .../convex/_generated/api.d.ts | 20 ++++++------- .../convex/_generated/api.js | 6 ++-- .../convex/_generated/dataModel.d.ts | 14 +++++----- .../convex/_generated/server.d.ts | 28 +++++++++---------- .../convex/_generated/server.js | 16 +++++------ .../start-convex-trellaux/convex/board.ts | 6 ++-- 6 files changed, 45 insertions(+), 45 deletions(-) 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 85c98ae192..b565b5276d 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/api.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/api.d.ts @@ -14,9 +14,9 @@ import type { ApiFromModules, FilterApi, FunctionReference, -} from "convex/server"; -import type * as board from "../board.js"; -import type * as crons from "../crons.js"; +} 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,16 +27,16 @@ import type * as crons from "../crons.js"; * ``` */ declare const fullApi: ApiFromModules<{ - board: typeof board; - crons: typeof crons; -}>; + board: typeof board + crons: typeof crons +}> export declare const api: FilterApi< typeof fullApi, - FunctionReference ->; + FunctionReference +> export declare const internal: FilterApi< typeof fullApi, - FunctionReference ->; + FunctionReference +> /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/api.js b/examples/react/start-convex-trellaux/convex/_generated/api.js index b5f2e089da..f5eb6204e5 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/api.js +++ b/examples/react/start-convex-trellaux/convex/_generated/api.js @@ -10,7 +10,7 @@ * @module */ -import { anyApi } from "convex/server"; +import { anyApi } from 'convex/server' /** * A utility for referencing Convex functions in your app's API. @@ -20,7 +20,7 @@ import { anyApi } from "convex/server"; * const myFunctionReference = api.myModule.myFunction; * ``` */ -export const api = anyApi; -export const internal = anyApi; +export const api = anyApi +export const internal = anyApi /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts b/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts index 91445dfc70..45f90d64e3 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/dataModel.d.ts @@ -15,14 +15,14 @@ import type { DocumentByName, TableNamesInDataModel, SystemTableNames, -} from "convex/server"; -import type { GenericId } from "convex/values"; -import schema from "../schema.js"; +} from 'convex/server' +import type { GenericId } from 'convex/values' +import schema from '../schema.js' /** * The names of all of your Convex tables. */ -export type TableNames = TableNamesInDataModel; +export type TableNames = TableNamesInDataModel /** * The type of a document stored in Convex. @@ -32,7 +32,7 @@ export type TableNames = TableNamesInDataModel; export type Doc = DocumentByName< DataModel, TableName ->; +> /** * An identifier for a document in Convex. @@ -48,7 +48,7 @@ export type Doc = DocumentByName< * @typeParam TableName - A string literal type of the table name (like "users"). */ export type Id = - GenericId; + GenericId /** * A type describing your Convex data model. @@ -59,6 +59,6 @@ export type Id = * This type is used to parameterize methods like `queryGeneric` and * `mutationGeneric` to make them type-safe. */ -export type DataModel = DataModelFromSchemaDefinition; +export type DataModel = DataModelFromSchemaDefinition /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/server.d.ts b/examples/react/start-convex-trellaux/convex/_generated/server.d.ts index 8190e1ff37..ffdf9e04e9 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/server.d.ts +++ b/examples/react/start-convex-trellaux/convex/_generated/server.d.ts @@ -20,8 +20,8 @@ import { GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter, -} from "convex/server"; -import type { DataModel } from "./dataModel.js"; +} from 'convex/server' +import type { DataModel } from './dataModel.js' /** * Define a query in this Convex app's public API. @@ -31,7 +31,7 @@ import type { DataModel } from "./dataModel.js"; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const query: QueryBuilder; +export declare const query: QueryBuilder /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -41,7 +41,7 @@ export declare const query: QueryBuilder; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const internalQuery: QueryBuilder; +export declare const internalQuery: QueryBuilder /** * Define a mutation in this Convex app's public API. @@ -51,7 +51,7 @@ export declare const internalQuery: QueryBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const mutation: MutationBuilder; +export declare const mutation: MutationBuilder /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -61,7 +61,7 @@ export declare const mutation: MutationBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const internalMutation: MutationBuilder; +export declare const internalMutation: MutationBuilder /** * Define an action in this Convex app's public API. @@ -74,7 +74,7 @@ export declare const internalMutation: MutationBuilder; * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export declare const action: ActionBuilder; +export declare const action: ActionBuilder /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -82,7 +82,7 @@ export declare const action: ActionBuilder; * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export declare const internalAction: ActionBuilder; +export declare const internalAction: ActionBuilder /** * Define an HTTP action. @@ -94,7 +94,7 @@ export declare const internalAction: ActionBuilder; * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. */ -export declare const httpAction: HttpActionBuilder; +export declare const httpAction: HttpActionBuilder /** * A set of services for use within Convex query functions. @@ -105,7 +105,7 @@ export declare const httpAction: HttpActionBuilder; * This differs from the {@link MutationCtx} because all of the services are * read-only. */ -export type QueryCtx = GenericQueryCtx; +export type QueryCtx = GenericQueryCtx /** * A set of services for use within Convex mutation functions. @@ -113,7 +113,7 @@ export type QueryCtx = GenericQueryCtx; * The mutation context is passed as the first argument to any Convex mutation * function run on the server. */ -export type MutationCtx = GenericMutationCtx; +export type MutationCtx = GenericMutationCtx /** * A set of services for use within Convex action functions. @@ -121,7 +121,7 @@ export type MutationCtx = GenericMutationCtx; * The action context is passed as the first argument to any Convex action * function run on the server. */ -export type ActionCtx = GenericActionCtx; +export type ActionCtx = GenericActionCtx /** * An interface to read from the database within Convex query functions. @@ -130,7 +130,7 @@ export type ActionCtx = GenericActionCtx; * document by its {@link Id}, or {@link DatabaseReader.query}, which starts * building a query. */ -export type DatabaseReader = GenericDatabaseReader; +export type DatabaseReader = GenericDatabaseReader /** * An interface to read from and write to the database within Convex mutation @@ -141,6 +141,6 @@ export type DatabaseReader = GenericDatabaseReader; * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control) * for the guarantees Convex provides your functions. */ -export type DatabaseWriter = GenericDatabaseWriter; +export type DatabaseWriter = GenericDatabaseWriter /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/_generated/server.js b/examples/react/start-convex-trellaux/convex/_generated/server.js index 33b487cd24..a557aec2c8 100644 --- a/examples/react/start-convex-trellaux/convex/_generated/server.js +++ b/examples/react/start-convex-trellaux/convex/_generated/server.js @@ -18,7 +18,7 @@ import { internalActionGeneric, internalMutationGeneric, internalQueryGeneric, -} from "convex/server"; +} from 'convex/server' /** * Define a query in this Convex app's public API. @@ -28,7 +28,7 @@ import { * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export const query = queryGeneric; +export const query = queryGeneric /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -38,7 +38,7 @@ export const query = queryGeneric; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export const internalQuery = internalQueryGeneric; +export const internalQuery = internalQueryGeneric /** * Define a mutation in this Convex app's public API. @@ -48,7 +48,7 @@ export const internalQuery = internalQueryGeneric; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export const mutation = mutationGeneric; +export const mutation = mutationGeneric /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -58,7 +58,7 @@ export const mutation = mutationGeneric; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export const internalMutation = internalMutationGeneric; +export const internalMutation = internalMutationGeneric /** * Define an action in this Convex app's public API. @@ -71,7 +71,7 @@ export const internalMutation = internalMutationGeneric; * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export const action = actionGeneric; +export const action = actionGeneric /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -79,7 +79,7 @@ export const action = actionGeneric; * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export const internalAction = internalActionGeneric; +export const internalAction = internalActionGeneric /** * Define a Convex HTTP action. @@ -88,6 +88,6 @@ export const internalAction = internalActionGeneric; * as its second. * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`. */ -export const httpAction = httpActionGeneric; +export const httpAction = httpActionGeneric /* prettier-ignore-end */ diff --git a/examples/react/start-convex-trellaux/convex/board.ts b/examples/react/start-convex-trellaux/convex/board.ts index 219d539de3..91fce9a1ef 100644 --- a/examples/react/start-convex-trellaux/convex/board.ts +++ b/examples/react/start-convex-trellaux/convex/board.ts @@ -28,17 +28,17 @@ export const seed = internalMutation(async (ctx) => { }) // Clear all boards (do this on a regular cadence for public examples) -export const clear = internalMutation(async ctx => { +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.delete(board._id) } await ctx.db.insert('boards', { id: '1', name: 'First board', color: '#e0e0e0', }) -}); +}) function withoutSystemFields }>( doc: T,