Skip to content

Commit

Permalink
fix(database): fix types in mongoose (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPdgn committed Jul 18, 2023
1 parent 9c59341 commit 818be97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class MongooseSchema extends SchemaAdapter<Model<any>> {
scope?: string;
populate?: string[];
},
) {
): Promise<any> {
let parsedFilter: Indexable | null = parseQuery(this.parseStringToQuery(filterQuery));
parsedFilter = await this.getAuthorizedQuery(
'edit',
Expand Down Expand Up @@ -158,7 +158,7 @@ export class MongooseSchema extends SchemaAdapter<Model<any>> {
scope?: string;
populate?: string[];
},
) {
): Promise<any> {
let parsedFilter: Indexable | null = parseQuery(this.parseStringToQuery(filterQuery));
parsedFilter = await this.getAuthorizedQuery(
'edit',
Expand Down Expand Up @@ -259,7 +259,7 @@ export class MongooseSchema extends SchemaAdapter<Model<any>> {
userId?: string;
scope?: string;
},
) {
): Promise<any> {
let { parsedQuery, modified } = await this.getPaginatedAuthorizedQuery(
'read',
parseQuery(this.parseStringToQuery(query)),
Expand Down Expand Up @@ -296,7 +296,7 @@ export class MongooseSchema extends SchemaAdapter<Model<any>> {
select?: string;
populate?: string[];
},
) {
): Promise<any> {
let parsedQuery: Indexable | null = parseQuery(this.parseStringToQuery(query));
parsedQuery = await this.getAuthorizedQuery(
'read',
Expand Down
1 change: 0 additions & 1 deletion modules/database/src/adapters/mongoose-adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class MongooseAdapter extends DatabaseAdapter<MongooseSchema> {
mongoose: Mongoose;
connectionString: string;
options: ConnectOptions = {
keepAlive: true,
minPoolSize: 5,
connectTimeoutMS: this.maxConnTimeoutMs,
serverSelectionTimeoutMS: this.maxConnTimeoutMs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class CustomEndpointsAdmin {
.getSchemaModel('CustomEndpoints')
.model.findMany({})
.then(r =>
r.map(obj => {
r.map((obj: any) => {
delete obj._id;
delete obj.selectedSchema;
delete obj.createdAt;
Expand Down

0 comments on commit 818be97

Please sign in to comment.