mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix ManyToManyRelation to respect select from with query
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { Api, type ApiOptions } from "Api";
|
|
||||||
import type { CreateUserPayload } from "auth/AppAuth";
|
import type { CreateUserPayload } from "auth/AppAuth";
|
||||||
import { $console } from "core";
|
import { $console } from "core";
|
||||||
import { Event } from "core/events";
|
import { Event } from "core/events";
|
||||||
@@ -15,6 +14,9 @@ import * as SystemPermissions from "modules/permissions";
|
|||||||
import { AdminController, type AdminControllerOptions } from "modules/server/AdminController";
|
import { AdminController, type AdminControllerOptions } from "modules/server/AdminController";
|
||||||
import { SystemController } from "modules/server/SystemController";
|
import { SystemController } from "modules/server/SystemController";
|
||||||
|
|
||||||
|
// biome-ignore
|
||||||
|
import { Api, type ApiOptions } from "Api";
|
||||||
|
|
||||||
export type AppPlugin = (app: App) => Promise<void> | void;
|
export type AppPlugin = (app: App) => Promise<void> | void;
|
||||||
|
|
||||||
abstract class AppEvent<A = {}> extends Event<{ app: App } & A> {}
|
abstract class AppEvent<A = {}> extends Event<{ app: App } & A> {}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export class ManyToManyRelation extends EntityRelation<typeof ManyToManyRelation
|
|||||||
eb
|
eb
|
||||||
.selectFrom(other.entity.name)
|
.selectFrom(other.entity.name)
|
||||||
.select((eb2) => {
|
.select((eb2) => {
|
||||||
const select: any[] = other.entity.getSelect(other.entity.name);
|
const select: any[] = [];
|
||||||
if (additionalFields.length > 0) {
|
if (additionalFields.length > 0) {
|
||||||
const conn = this.connectionEntity.name;
|
const conn = this.connectionEntity.name;
|
||||||
select.push(
|
select.push(
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ export const withSchema = <TSelf extends TThis>(Self: TSelf) =>
|
|||||||
// { "images": {} }
|
// { "images": {} }
|
||||||
|
|
||||||
if (!Array.isArray(value) && isObject(value)) {
|
if (!Array.isArray(value) && isObject(value)) {
|
||||||
console.log("is object");
|
|
||||||
return value as RepoWithSchema;
|
return value as RepoWithSchema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user