-
Notifications
You must be signed in to change notification settings - Fork 820
Open
Description
As of now the type definitions require this
await conn.reducers.updateCategory({
id: BigInt(1),
name: 'updated category name',
buttonText: undefined,
headerText: undefined,
deleted: undefined,
});However, the following works just fine, except for type errors
await conn.reducers.updateCategory({
id: BigInt(1),
name: 'updated category name',
});Argument of type '{ id: bigint; name: string; }' is not assignable to parameter of type 'InferTypeOfRow<CoerceRow<{ id: U64Builder; name: OptionBuilder<StringBuilder>; buttonText: OptionBuilder<StringBuilder>; headerText: OptionBuilder<...>; deleted: OptionBuilder<...>; }>>'.
Type '{ id: bigint; name: string; }' is missing the following properties from type 'InferTypeOfRow<CoerceRow<{ id: U64Builder; name: OptionBuilder<StringBuilder>; buttonText: OptionBuilder<StringBuilder>; headerText: OptionBuilder<...>; deleted: OptionBuilder<...>; }>>': buttonText, headerText, deleted
The reducer in question
const updateSchema = {
id: t.u64(),
name: t.string().optional(),
buttonText: t.string().optional(),
headerText: t.string().optional(),
deleted: t.bool().optional(),
};
export const updateCategory = db.reducer(updateSchema, (ctx, input) => {
/**update code here**/
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels