Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(database): Mongoose types #662

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
scope?: string;
populate?: string[];
},
) {
): Promise<any> {

Check notice on line 130 in modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts

View check run for this annotation

codefactor.io / CodeFactor

modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts#L130

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
let parsedFilter: Indexable | null = parseQuery(this.parseStringToQuery(filterQuery));
parsedFilter = await this.getAuthorizedQuery(
'edit',
Expand Down Expand Up @@ -158,7 +158,7 @@
scope?: string;
populate?: string[];
},
) {
): Promise<any> {

Check notice on line 161 in modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts

View check run for this annotation

codefactor.io / CodeFactor

modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts#L161

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
let parsedFilter: Indexable | null = parseQuery(this.parseStringToQuery(filterQuery));
parsedFilter = await this.getAuthorizedQuery(
'edit',
Expand Down Expand Up @@ -259,7 +259,7 @@
userId?: string;
scope?: string;
},
) {
): Promise<any> {

Check notice on line 262 in modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts

View check run for this annotation

codefactor.io / CodeFactor

modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts#L262

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
let { parsedQuery, modified } = await this.getPaginatedAuthorizedQuery(
'read',
parseQuery(this.parseStringToQuery(query)),
Expand Down Expand Up @@ -296,7 +296,7 @@
select?: string;
populate?: string[];
},
) {
): Promise<any> {

Check notice on line 299 in modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts

View check run for this annotation

codefactor.io / CodeFactor

modules/database/src/adapters/mongoose-adapter/MongooseSchema.ts#L299

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-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 @@
.getSchemaModel('CustomEndpoints')
.model.findMany({})
.then(r =>
r.map(obj => {
r.map((obj: any) => {

Check notice on line 39 in modules/database/src/admin/customEndpoints/customEndpoints.admin.ts

View check run for this annotation

codefactor.io / CodeFactor

modules/database/src/admin/customEndpoints/customEndpoints.admin.ts#L39

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
delete obj._id;
delete obj.selectedSchema;
delete obj.createdAt;
Expand Down