mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-09-20 15:12:00 +00:00
fix(handler): add operation type to hook context
This commit is contained in:
@@ -311,6 +311,7 @@ func (h *Handler) handleRead(ctx context.Context, w common.ResponseWriter, id st
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "read",
|
||||||
Options: options,
|
Options: options,
|
||||||
ID: id,
|
ID: id,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -727,6 +728,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: v,
|
Data: v,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -774,6 +776,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: v,
|
Data: v,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -856,6 +859,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: item,
|
Data: item,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -903,6 +907,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: item,
|
Data: item,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -987,6 +992,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: itemMap,
|
Data: itemMap,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -1040,6 +1046,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: itemMap,
|
Data: itemMap,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -1171,6 +1178,7 @@ func (h *Handler) handleUpdate(ctx context.Context, w common.ResponseWriter, url
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "update",
|
||||||
Options: options,
|
Options: options,
|
||||||
ID: urlID,
|
ID: urlID,
|
||||||
Data: updates,
|
Data: updates,
|
||||||
@@ -1392,6 +1400,7 @@ func (h *Handler) handleUpdate(ctx context.Context, w common.ResponseWriter, url
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "update",
|
||||||
Options: options,
|
Options: options,
|
||||||
ID: itemIDStr,
|
ID: itemIDStr,
|
||||||
Data: item,
|
Data: item,
|
||||||
@@ -1548,6 +1557,7 @@ func (h *Handler) handleUpdate(ctx context.Context, w common.ResponseWriter, url
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "update",
|
||||||
Options: options,
|
Options: options,
|
||||||
ID: itemIDStr,
|
ID: itemIDStr,
|
||||||
Data: itemMap,
|
Data: itemMap,
|
||||||
@@ -1653,6 +1663,7 @@ func (h *Handler) handleDelete(ctx context.Context, w common.ResponseWriter, id
|
|||||||
Schema: schema,
|
Schema: schema,
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "delete",
|
||||||
ID: id,
|
ID: id,
|
||||||
Data: data,
|
Data: data,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
|
|||||||
@@ -379,6 +379,7 @@ func (h *Handler) handleRead(ctx context.Context, w common.ResponseWriter, id st
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "read",
|
||||||
Options: options,
|
Options: options,
|
||||||
ID: id,
|
ID: id,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -1236,6 +1237,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: data,
|
Data: data,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -1335,6 +1337,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "create",
|
||||||
Options: options,
|
Options: options,
|
||||||
Data: modelValue,
|
Data: modelValue,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
@@ -1489,6 +1492,7 @@ func (h *Handler) handleUpdate(ctx context.Context, w common.ResponseWriter, id
|
|||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Tx: tx,
|
Tx: tx,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "update",
|
||||||
Options: options,
|
Options: options,
|
||||||
ID: id,
|
ID: id,
|
||||||
Data: dataMap,
|
Data: dataMap,
|
||||||
@@ -1686,6 +1690,7 @@ func (h *Handler) handleDelete(ctx context.Context, w common.ResponseWriter, id
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "delete",
|
||||||
ID: itemID,
|
ID: itemID,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
Tx: tx,
|
Tx: tx,
|
||||||
@@ -1760,6 +1765,7 @@ func (h *Handler) handleDelete(ctx context.Context, w common.ResponseWriter, id
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "delete",
|
||||||
ID: itemIDStr,
|
ID: itemIDStr,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
Tx: tx,
|
Tx: tx,
|
||||||
@@ -1818,6 +1824,7 @@ func (h *Handler) handleDelete(ctx context.Context, w common.ResponseWriter, id
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "delete",
|
||||||
ID: itemIDStr,
|
ID: itemIDStr,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
Tx: tx,
|
Tx: tx,
|
||||||
@@ -1902,6 +1909,7 @@ func (h *Handler) handleDelete(ctx context.Context, w common.ResponseWriter, id
|
|||||||
Entity: entity,
|
Entity: entity,
|
||||||
TableName: tableName,
|
TableName: tableName,
|
||||||
Model: model,
|
Model: model,
|
||||||
|
Operation: "delete",
|
||||||
ID: id,
|
ID: id,
|
||||||
Writer: w,
|
Writer: w,
|
||||||
Tx: h.db,
|
Tx: h.db,
|
||||||
|
|||||||
Reference in New Issue
Block a user