mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 12:47:45 +02:00
Fixed mixin projections in postgres adapter (#8838)
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
@@ -554,6 +554,9 @@ export function convertArrayParams (parameters?: ParameterOrJSON<any>[]): any[]
|
||||
}
|
||||
|
||||
export function filterProjection<T extends Doc> (data: any, projection: Projection<T> | undefined): any {
|
||||
if (projection === undefined) {
|
||||
return data
|
||||
}
|
||||
for (const key in data) {
|
||||
if (!Object.prototype.hasOwnProperty.call(projection, key) || (projection as any)[key] === 0) {
|
||||
// check nested projections in case of object
|
||||
|
||||
Reference in New Issue
Block a user