Skip to content

Commit 12e5f79

Browse files
committed
Fix procedure types
1 parent 33ebb61 commit 12e5f79

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// ─────────────────────────────────────────────────────────────────────────────
22
// IMPORTS
33
// ─────────────────────────────────────────────────────────────────────────────
4+
import { ScheduleAt } from 'spacetimedb';
45
import {
56
errors,
67
schema,
@@ -145,7 +146,7 @@ spacetimedb.procedure('insert_with_tx_rollback', t.unit(), ctx => {
145146
});
146147

147148
spacetimedb.reducer('schedule_proc', {}, ctx => {
148-
ctx.db.scheduled_proc_table.insert({
149+
ctx.db.scheduledProcTable.insert({
149150
scheduled_id: 0n,
150151
scheduled_at: ScheduleAt.interval(1000000n),
151152
reducer_ts: ctx.timestamp,
@@ -160,7 +161,7 @@ spacetimedb.procedure('scheduled_proc', { data: ScheduledProcTable }, t.unit(),
160161
const y = data.y;
161162
const procedure_ts = ctx.timestamp;
162163
ctx.withTx(ctx => {
163-
ctx.db.proc_inserts_into.insert({
164+
ctx.db.procInsertsInto.insert({
164165
reducer_ts,
165166
procedure_ts,
166167
x,

0 commit comments

Comments
 (0)