mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-15 16:25:20 +00:00
fix(websocketspec): add transaction access to HookContext
This commit is contained in:
@@ -174,6 +174,7 @@ func (h *Handler) handleRequest(conn *Connection, msg *Message) {
|
||||
Options: msg.Options,
|
||||
ID: recordID,
|
||||
Data: msg.Data,
|
||||
Tx: h.db,
|
||||
Metadata: make(map[string]interface{}),
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,9 @@ type HookContext struct {
|
||||
AbortMessage string // Message to return if aborted
|
||||
AbortCode int // HTTP status code if aborted
|
||||
|
||||
// Tx provides access to the database/transaction for executing additional SQL
|
||||
Tx common.Database
|
||||
|
||||
// Metadata is additional context data
|
||||
Metadata map[string]interface{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user