Skip to content

Commit

Permalink
#1410 Make number of element optional
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jun 29, 2020
1 parent c3c4a73 commit 8876705
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/controllers/v1/AlertCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AlertCtrl @Inject() (
FieldsParser[OutputParam],
(range, alertSteps, _) =>
alertSteps
.richPage(range.from, range.to, withTotal = true)(_.richAlert)
.richPage(range.from, range.to, range.extraData.contains("total"))(_.richAlert)
)
override val outputQuery: Query = Query.output[RichAlert, AlertSteps](_.richAlert)
override val extraQueries: Seq[ParamQuery[_]] = Seq(
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/controllers/v1/AuditCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AuditCtrl @Inject() (entrypoint: Entrypoint, @Named("with-thehive-schema")
Query.withParam[OutputParam, AuditSteps, PagedResult[RichAudit]](
"page",
FieldsParser[OutputParam],
(range, auditSteps, _) => auditSteps.richPage(range.from, range.to, withTotal = true)(_.richAudit)
(range, auditSteps, _) => auditSteps.richPage(range.from, range.to, range.extraData.contains("total"))(_.richAudit)
)
override val outputQuery: Query = Query.output[RichAudit, AuditSteps](_.richAudit)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CaseTemplateCtrl @Inject() (
override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, CaseTemplateSteps, PagedResult[RichCaseTemplate]](
"page",
FieldsParser[OutputParam],
(range, caseTemplateSteps, _) => caseTemplateSteps.richPage(range.from, range.to, withTotal = true)(_.richCaseTemplate)
(range, caseTemplateSteps, _) => caseTemplateSteps.richPage(range.from, range.to, range.extraData.contains("total"))(_.richCaseTemplate)
)
override val outputQuery: Query = Query.output[RichCaseTemplate, CaseTemplateSteps](_.richCaseTemplate)
override val extraQueries: Seq[ParamQuery[_]] = Seq()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OrganisationCtrl @Inject() (
override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, OrganisationSteps, PagedResult[RichOrganisation]](
"page",
FieldsParser[OutputParam],
(range, organisationSteps, _) => organisationSteps.richPage(range.from, range.to, withTotal = true)(_.richOrganisation)
(range, organisationSteps, _) => organisationSteps.richPage(range.from, range.to, range.extraData.contains("total"))(_.richOrganisation)
)
override val outputQuery: Query = Query.output[RichOrganisation, OrganisationSteps](_.richOrganisation)
override val getQuery: ParamQuery[IdOrName] = Query.initWithParam[IdOrName, OrganisationSteps](
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/controllers/v1/TaskCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TaskCtrl @Inject() (
override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, TaskSteps, PagedResult[RichTask]](
"page",
FieldsParser[OutputParam],
(range, taskSteps, _) => taskSteps.richPage(range.from, range.to, withTotal = true)(_.richTask)
(range, taskSteps, _) => taskSteps.richPage(range.from, range.to, range.extraData.contains("total"))(_.richTask)
)
override val getQuery: ParamQuery[IdOrName] = Query.initWithParam[IdOrName, TaskSteps](
"getTask",
Expand Down
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/controllers/v1/UserCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class UserCtrl @Inject() (
override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, UserSteps, PagedResult[RichUser]](
"page",
FieldsParser[OutputParam],
(range, userSteps, authContext) => userSteps.richUser(authContext.organisation).page(range.from, range.to, withTotal = true)
(range, userSteps, authContext) => userSteps.richUser(authContext.organisation).page(range.from, range.to, range.extraData.contains("total"))
)
override val outputQuery: Query =
Query.outputWithContext[RichUser, UserSteps]((userSteps, authContext) => userSteps.richUser(authContext.organisation))
Expand Down

0 comments on commit 8876705

Please sign in to comment.