-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added get filters route to show available filters when creating a report
- Loading branch information
1 parent
f9bbfc5
commit 898ecb4
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { graphqlQuery } from '#src/utils'; | ||
|
||
export const getFilters = async ({ request, reply }) => { | ||
const response = (await graphqlQuery({ | ||
query: `{ | ||
messages { | ||
value: id | ||
label: message | ||
} | ||
tags { | ||
value: id | ||
label: tag | ||
} | ||
properties { | ||
value: id | ||
label: name | ||
} | ||
urls { | ||
value: id | ||
label: url | ||
} | ||
}` | ||
}))?.data; | ||
|
||
return { | ||
status: 'success', | ||
result: { ...response, statuses: { label: 'Active', value: 'Active' } }, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters