You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently needed to add a ComplexFilter to a condition when saving an object because we required an OR condition. However, at the moment, the save function only supports the Filter type. When using conditions with the save function, if we provide a Filter structure, it only builds an AND condition. Upon reviewing the code, I found that it could actually support the ComplexFilter type. I tested it with the following code, avoiding type errors, and it worked.
await courierOrderLock.save({
// @ts-expect-error: use complex filter
operator: "put",
// @ts-expect-error: use complex filter
conditions: [
{
pk: ["not exists"],
},
"OR",
{
nextAllowedAt: ["<", new Date()],
},
],
});
I believe an update should be made so that the save() function officially supports ComplexFilter as a parameter.
The text was updated successfully, but these errors were encountered:
We recently needed to add a ComplexFilter to a condition when saving an object because we required an OR condition. However, at the moment, the save function only supports the Filter type. When using conditions with the save function, if we provide a Filter structure, it only builds an AND condition. Upon reviewing the code, I found that it could actually support the ComplexFilter type. I tested it with the following code, avoiding type errors, and it worked.
I believe an update should be made so that the save() function officially supports ComplexFilter as a parameter.
The text was updated successfully, but these errors were encountered: