Skip to content

Commit

Permalink
fix: getGraph case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
loopingz committed Nov 15, 2023
1 parent 7e91d3e commit a35ea49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/core/src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,10 @@ export class Application {
* Get model graph
*/
getRelations(model: string | Constructor<CoreModel> | CoreModel) {
return this.getGraph()[typeof model === "string" ? this.completeNamespace(model) : this.getModelName(model)] || {};
const name = typeof model === "string" ? this.completeNamespace(model) : this.getModelName(model);
// Get relations should not be case-sensitive until v4
const key = Object.keys(this.graph).find(k => k?.toLowerCase() === name?.toLowerCase());
return this.getGraph()[key] || {};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/models/coremodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function Expose(params: Partial<ExposeParameters> = {}) {
/**
*
*/
class CoreModelQuery {
export class CoreModelQuery {
@NotEnumerable
private type: string;
@NotEnumerable
Expand Down

0 comments on commit a35ea49

Please sign in to comment.