getmyself
This commit is contained in:
@@ -182,11 +182,11 @@ func GenericRawUpdateOne(set DBObject, id string, a Accessor) (DBObject, int, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetMySelf(wfa Accessor) (ShallowDBObject, error) {
|
func GetMySelf(wfa Accessor) (ShallowDBObject, error) {
|
||||||
id, err := GenerateNodeID()
|
datas, _, _ := wfa.Search(&dbs.Filters{
|
||||||
if err != nil {
|
And: map[string][]dbs.Filter{
|
||||||
return nil, err
|
"relation": {{Operator: dbs.EQUAL.String(), Value: 1}},
|
||||||
}
|
},
|
||||||
datas, _, _ := wfa.Search(nil, id, false)
|
}, "", false)
|
||||||
if len(datas) > 0 {
|
if len(datas) > 0 {
|
||||||
return datas[0], nil
|
return datas[0], nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user