GetOne should use id

This commit is contained in:
George Suntres
2026-04-14 19:28:40 -04:00
parent fedad18a59
commit 2c7d9653c2
3 changed files with 21 additions and 8 deletions

View File

@@ -44,7 +44,7 @@ func BuildGetOne(col map[string]any, report *InitReport) {
mc := mongo.GetMongoClient()
// we defer function's implementation until we create the actual struct
deferedFuncs[funcName] = func(ctx context.Context, data map[string]any) (bson.M, error) {
deferedFuncs[funcName] = func(ctx context.Context, id string) (bson.M, error) {
db := "__undefined__"
if isSystem {
db = sysDb
@@ -55,6 +55,6 @@ func BuildGetOne(col map[string]any, report *InitReport) {
}
}
return mc.GetOne(ctx, db, name, data)
return mc.GetOne(ctx, db, name, id)
}
}