Compare commits

..
1 Commits
Author SHA1 Message Date
warkanum d6c5740f9c fix(handler): add operation type to hook context
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after 1s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Failing after 1s
Build , Vet Test, and Lint / Lint Code (push) Failing after 1s
Build , Vet Test, and Lint / Build (push) Failing after 1s
Tests / Unit Tests (push) Failing after 0s
Tests / Integration Tests (push) Failing after 10s
2026-09-20 16:12:44 +02:00
2 changed files with 121 additions and 102 deletions
+11
View File
@@ -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,
+8
View File
@@ -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,