fix(board): use plain number refs in event payloads

OGraph Engine expects ref fields (subject, assignee) as plain numbers,
not {ref: N} objects. The old format caused 500 errors on event emit.
This commit is contained in:
小糯 🐱 2026-04-13 17:00:29 +08:00
parent 8702e8b1c3
commit edeb549162

View File

@ -132,7 +132,7 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_created",
payload: {
subject: { ref: obj.id },
subject: obj.id,
title: data.title,
priority: data.priority ?? "p2",
...(data.description ? { description: data.description } : {}),
@ -147,8 +147,8 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_assigned",
payload: {
subject: { ref: obj.id },
assignee: { ref: data.assigneeId },
subject: obj.id,
assignee: data.assigneeId,
},
}),
})
@ -162,7 +162,7 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_status_changed",
payload: {
subject: { ref: obj.id },
subject: obj.id,
status,
},
}),
@ -194,7 +194,7 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_status_changed",
payload: {
subject: { ref: id },
subject: id,
status: data.status,
},
}),
@ -209,8 +209,8 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_assigned",
payload: {
subject: { ref: id },
assignee: data.assigneeId ? { ref: data.assigneeId } : null,
subject: id,
assignee: data.assigneeId ?? null,
},
}),
})
@ -241,7 +241,7 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_status_changed",
payload: {
subject: { ref: _id },
subject: _id,
status: "done",
},
}),
@ -254,7 +254,7 @@ export class OGraphClient implements TaskAPI {
body: JSON.stringify({
type: "task_status_changed",
payload: {
subject: { ref: id },
subject: id,
status,
},
}),