forked from reactplay/react-play
-
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.
Merge branch 'main' of https://github.com/reactplay/react-play
- Loading branch information
Showing
7 changed files
with
737 additions
and
1 deletion.
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 @@ | ||
# Will remove this directory once the API stabilizes |
271 changes: 271 additions & 0 deletions
271
src/common/services/request/example/fetch-plays-filter.js
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,271 @@ | ||
export const FetchPlaysFilter = [ | ||
// Filter all the featured plays | ||
{ | ||
display: "Filter all the featured plays", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "", | ||
clause: [ | ||
{ | ||
field: "featured", | ||
operator: "eq", | ||
value: true, | ||
type: "boolean", | ||
}, | ||
], | ||
}, | ||
}, | ||
// Filter Plays by a search string in name or description | ||
{ | ||
display: "Filter Plays by a search string in name or description", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "or", | ||
clause: [ | ||
{ | ||
field: "name", | ||
operator: "iregex", | ||
value: "why", | ||
type: "string", | ||
}, | ||
{ | ||
field: "description", | ||
operator: "iregex", | ||
value: "why", | ||
type: "string", | ||
}, | ||
], | ||
}, | ||
}, | ||
// Filter Plays by Level | ||
{ | ||
display: "Filter Plays by Level", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "", | ||
class: "level", | ||
clause: [ | ||
{ | ||
field: "name", | ||
operator: "eq", | ||
value: "Advanced", | ||
type: "string", | ||
}, | ||
], | ||
}, | ||
}, | ||
// Alternatively using the id | ||
{ | ||
display: "Alternatively using the id", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "", | ||
clause: [ | ||
{ | ||
field: "level_id", | ||
operator: "eq", | ||
value: "2af38a32-37a7-4456-b21b-bf6b3aedd804", | ||
type: "string", | ||
}, | ||
], | ||
}, | ||
}, | ||
// Filter plays by level, user and language | ||
{ | ||
display: "Filter plays by level, user and language", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ | ||
play_tags: { tag: ["name"] }, | ||
}, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "and", | ||
clause: [ | ||
{ | ||
field: "owner_user_id", | ||
operator: "eq", | ||
value: "0680f581-6584-4bc4-bbe9-aa7c97567e72", | ||
type: "string", | ||
}, | ||
{ | ||
field: "level_id", | ||
operator: "eq", | ||
value: "4127ed16-bf37-4c34-bed0-282cd646cd53", | ||
type: "string", | ||
}, | ||
{ | ||
field: "language", | ||
operator: "eq", | ||
value: "js", | ||
type: "string", | ||
}, | ||
], | ||
}, | ||
}, | ||
// Filter plays by level, user, language, and multiple tags | ||
{ | ||
display: "Filter plays by level, user, language, and multiple tags", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ | ||
play_tags: { tag: ["name"] }, | ||
where: { | ||
operator: "or", | ||
class: "tag", | ||
clause: [ | ||
{ | ||
field: "name", | ||
operator: "eq", | ||
value: "JSX", | ||
type: "string", | ||
}, | ||
{ | ||
field: "name", | ||
operator: "eq", | ||
value: "Schedule", | ||
type: "string", | ||
}, | ||
], | ||
}, | ||
}, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "and", | ||
clause: [ | ||
{ | ||
field: "owner_user_id", | ||
operator: "eq", | ||
value: "0680f581-6584-4bc4-bbe9-aa7c97567e72", | ||
type: "string", | ||
}, | ||
{ | ||
field: "level_id", | ||
operator: "eq", | ||
value: "4127ed16-bf37-4c34-bed0-282cd646cd53", | ||
type: "string", | ||
}, | ||
{ | ||
field: "language", | ||
operator: "eq", | ||
value: "js", | ||
type: "string", | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |
47 changes: 47 additions & 0 deletions
47
src/common/services/request/example/fetch-plays-paginated.js
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,47 @@ | ||
export const FetchPlaysPaginated = [ | ||
{ | ||
display: "Paginated play view", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
where: { | ||
operator: "", | ||
clause: [ | ||
{ | ||
field: "featured", | ||
operator: "eq", | ||
value: true, | ||
type: "boolean", | ||
}, | ||
], | ||
}, | ||
filters: [ | ||
{ | ||
field: "offset", | ||
value: 1, | ||
}, | ||
{ | ||
field: "limit", | ||
value: 4, | ||
}, | ||
], | ||
}, | ||
]; |
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,32 @@ | ||
export const FetchPlaysSorted = [ | ||
{ | ||
display: "Sorted play view", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
orders: [ | ||
{ | ||
field: "created_at", | ||
value: "asc", | ||
}, | ||
], | ||
}, | ||
]; |
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,26 @@ | ||
export const FetchPlaysSimple = [ | ||
{ | ||
display: "Simple fetch play", | ||
name: "Fetch_Plays", | ||
function: "plays", | ||
write: false, | ||
params: [ | ||
"blog", | ||
"component", | ||
"cover", | ||
"created_at", | ||
"description", | ||
"featured", | ||
"github", | ||
"id", | ||
"language", | ||
{ level: ["name"] }, | ||
"name", | ||
"path", | ||
{ play_tags: { tag: ["name"] } }, | ||
"updated_at", | ||
{ user: ["id", "displayName", "avatarUrl"] }, | ||
"video", | ||
], | ||
}, | ||
]; |
Oops, something went wrong.