Skip to content

Commit a722cab

Browse files
committed
Fix procedure types
1 parent 33ebb61 commit a722cab

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

crates/bindings-typescript/src/lib/procedures.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ export function procedure<
3939
const paramsType: ProductType = {
4040
elements: Object.entries(params).map(([n, c]) => ({
4141
name: n,
42-
algebraicType:
43-
'typeBuilder' in c ? c.typeBuilder.algebraicType : c.algebraicType,
42+
algebraicType: registerTypesRecursively(
43+
'typeBuilder' in c ? c.typeBuilder : c
44+
).algebraicType,
4445
})),
4546
};
4647
const returnType = registerTypesRecursively(ret).algebraicType;

modules/sdk-test-procedure-ts/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// ─────────────────────────────────────────────────────────────────────────────
22
// IMPORTS
33
// ─────────────────────────────────────────────────────────────────────────────
4+
import { ScheduleAt } from 'spacetimedb';
45
import {
56
errors,
67
schema,
78
t,
89
table,
910
type ProcedureCtx,
10-
type ScheduleAt,
1111
type TransactionCtx,
1212
} from 'spacetimedb/server';
1313

@@ -145,7 +145,7 @@ spacetimedb.procedure('insert_with_tx_rollback', t.unit(), ctx => {
145145
});
146146

147147
spacetimedb.reducer('schedule_proc', {}, ctx => {
148-
ctx.db.scheduled_proc_table.insert({
148+
ctx.db.scheduledProcTable.insert({
149149
scheduled_id: 0n,
150150
scheduled_at: ScheduleAt.interval(1000000n),
151151
reducer_ts: ctx.timestamp,
@@ -160,7 +160,7 @@ spacetimedb.procedure('scheduled_proc', { data: ScheduledProcTable }, t.unit(),
160160
const y = data.y;
161161
const procedure_ts = ctx.timestamp;
162162
ctx.withTx(ctx => {
163-
ctx.db.proc_inserts_into.insert({
163+
ctx.db.procInsertsInto.insert({
164164
reducer_ts,
165165
procedure_ts,
166166
x,

0 commit comments

Comments
 (0)