Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
Arteha committed Oct 10, 2019
1 parent 08d331b commit 27e30a3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "admin-bro-typeorm",
"version": "0.1.0",
"version": "0.1.1",
"description": "TypeORM adapter for AdminBro",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Property extends (BaseProperty as any)

constructor(column: ColumnMetadata, path: string, model: typeof BaseEntity)
{
super({path: path}); // WARNING .field
super({path: path});
this.column = column;
this.model = model;
}
Expand All @@ -51,7 +51,6 @@ export class Property extends (BaseProperty as any)

public isEditable()
{
// return !this.column.isVirtual;
return true;
}

Expand Down
4 changes: 0 additions & 4 deletions src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export class Resource extends (BaseResource as any)
instance[p] = params[p];

await instance.save();
// const record = await this.findByPk(pk);
return instance as any;
}
throw new Error("Instance not found.");
Expand All @@ -157,9 +156,6 @@ export class Resource extends (BaseResource as any)
public async delete(pk)
{
await this.model.delete(pk);
/*const instance = await this.model.findOne(pk);
if (instance)
return instance.remove();*/
}

public createValidationError(originalError)
Expand Down
2 changes: 0 additions & 2 deletions src/utils/convertFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export function convertFilter(filter?: { resource: Resource, filters: Filters })
for(const n in filters)
{
const one = filters[n];
console.log(one.value);
if(["boolean", "number", "float", "object", "array"].includes(one.property.type()))
where[n] = JSON.parse(one.value);
if(["date", "datetime"].includes(one.property.type()))
Expand All @@ -31,7 +30,6 @@ export function convertFilter(filter?: { resource: Resource, filters: Filters })
else
where[n] = one.value;
}
console.log(where);
return where;
}
}

0 comments on commit 27e30a3

Please sign in to comment.