Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
holi-app-events
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
app
holi-app-events
Commits
d861cda4
Commit
d861cda4
authored
2 weeks ago
by
Gregor Schulz
Browse files
Options
Downloads
Patches
Plain Diff
invert filter logic for local
parent
83a730ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/fetch_events.ts
+6
-4
6 additions, 4 deletions
app/fetch_events.ts
app/server.ts
+3
-3
3 additions, 3 deletions
app/server.ts
with
9 additions
and
7 deletions
app/fetch_events.ts
+
6
−
4
View file @
d861cda4
...
...
@@ -60,7 +60,7 @@ const toHoliEvent = (event: AppApiEvent): HoliEvent => {
}
const
buildJasdAppApiUrl
=
(
{
limit
,
offset
,
location
,
remote
Only
}:
FetchEventsInput
,
{
limit
,
offset
,
location
,
local
Only
}:
FetchEventsInput
,
):
URL
=>
{
const
url
=
new
URL
(
`
${
APP_API_BASE_URL
}
/search`
)
url
.
searchParams
.
append
(
'
page
'
,
offset
.
toString
())
...
...
@@ -71,8 +71,10 @@ const buildJasdAppApiUrl = (
url
.
searchParams
.
append
(
'
includeExpiredActivities
'
,
'
false
'
)
url
.
searchParams
.
append
(
'
permanent
'
,
'
false
'
)
if
(
remoteOnly
)
{
url
.
searchParams
.
append
(
'
online
'
,
'
true
'
)
if
(
localOnly
)
{
url
.
searchParams
.
append
(
'
online
'
,
'
false
'
)
// true is returning only online events
// undefined is returning all
}
if
(
location
)
{
...
...
@@ -128,8 +130,8 @@ const fetchEventsPage = async (
export
type
FetchEventsInput
=
{
limit
:
number
offset
:
number
localOnly
:
boolean
location
?:
string
remoteOnly
?:
boolean
}
export
const
fetchEvents
=
async
(
...
...
This diff is collapsed.
Click to expand it.
app/server.ts
+
3
−
3
View file @
d861cda4
...
...
@@ -41,7 +41,7 @@ const SCHEMA = `
type Query {
# uses offset-based pagination as described in https://www.apollographql.com/docs/react/pagination/offset-based
events(offset: Int = 0, limit: Int = 5, location: String,
remote
Only: Boolean): EventsResponse!
events(offset: Int = 0, limit: Int = 5, location: String,
local
Only: Boolean): EventsResponse!
event(id: String!): EventResponse!
}
`
...
...
@@ -50,7 +50,7 @@ export type EventsRequest = {
limit
?:
number
offset
?:
number
location
?:
string
remote
Only
?:
boolean
local
Only
?:
boolean
}
export
type
EventRequest
=
{
...
...
@@ -69,7 +69,7 @@ const validateEventsRequestInput = (request: EventsRequest): FetchEventsInput =>
limit
:
limit
,
offset
:
request
.
offset
??
0
,
location
:
request
.
location
,
remote
Only
:
request
.
remoteOnly
,
local
Only
:
request
.
localOnly
??
false
,
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment