MCPcopy Create free account
hub / github.com/axe-api/axe-api / get

Method get

packages/axe-api/src/Services/QueryService.ts:123–147  ·  view source on GitHub ↗
(query: URLSearchParams)

Source from the content-addressed store, hash-verified

121 }
122
123 get(query: URLSearchParams): IQuery {
124 const conditions: IQuery = this.parseSections(query);
125 const usedColumns: string[] = this.getUsedColumns(conditions);
126 const undefinedColumns = usedColumns.filter((columnName) => {
127 let currentModel: IModelService | undefined = this.model;
128 let realColumName = columnName;
129 if (columnName.includes(".")) {
130 const [table, splittedColumnName] = columnName.split(".");
131 currentModel = this.models.find(
132 (model) => model.instance.table === table,
133 );
134 realColumName = splittedColumnName;
135 }
136
137 return !currentModel || !currentModel.columnNames.includes(realColumName);
138 });
139
140 if (undefinedColumns.length > 0) {
141 throw new ApiError(
142 `Undefined column names: ${undefinedColumns.join(",")}`,
143 );
144 }
145
146 return conditions;
147 }
148
149 private getUsedColumns(conditions: IQuery) {
150 return [

Callers

nothing calls this directly

Calls 3

parseSectionsMethod · 0.95
getUsedColumnsMethod · 0.95
findMethod · 0.80

Tested by

no test coverage detected