-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: departments controllers #75
base: main
Are you sure you want to change the base?
Conversation
gradientStart: "red", | ||
gradientStop: "blue", | ||
}); | ||
await Department.createMany([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's nice that you added such realistic data :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, but there are still some comments that weren't addressed.
async index({ request }: HttpContext) { | ||
const { page, limit } = await request.validateUsing(paginationValidator); | ||
const baseQuery = FieldsOfStudy.query().withScopes((scopes) => { | ||
scopes.preloadRelations(request.only(this.relations)); | ||
scopes.handleSortQuery(request.input("sort")); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scope for searching is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final round of changes?
app/models/department_link.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can now revert the changes mage to this file
const baseQuery = FieldsOfStudy.query().withScopes((scopes) => { | ||
scopes.handleSearchQuery( | ||
request.only(["id", "name", "createdAt", "updatedAt"]), | ||
); | ||
scopes.preloadRelations(request.only(this.relations)); | ||
scopes.handleSortQuery(request.input("sort")); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we excluding so many fields that are potentially useful to filter by?
IMO only the url should not be searchable.
const baseQuery = FieldsOfStudy.query().withScopes((scopes) => { | |
scopes.handleSearchQuery( | |
request.only(["id", "name", "createdAt", "updatedAt"]), | |
); | |
scopes.preloadRelations(request.only(this.relations)); | |
scopes.handleSortQuery(request.input("sort")); | |
}); | |
const baseQuery = FieldsOfStudy.query().withScopes((scopes) => { | |
scopes.handleSearchQuery(request.qs(), "url"); | |
scopes.preloadRelations(request.only(this.relations)); | |
scopes.handleSortQuery(request.input("sort")); | |
}); |
scopes.handleSearchQuery( | ||
request.except([ | ||
"logo", | ||
"description", | ||
"gradientStart", | ||
"gradientStop", | ||
]), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scopes.handleSearchQuery( | |
request.except([ | |
"logo", | |
"description", | |
"gradientStart", | |
"gradientStop", | |
]), | |
); | |
scopes.handleSearchQuery( | |
request.qs(), | |
"logo", | |
"description", | |
"gradientStart", | |
"gradientStop", | |
); |
+ prettier cuz i typed this out by hand
…epartment_link model changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mikuu-252 you have to resolve conflicts
No description provided.