Skip to content

Commit

Permalink
AB#1064 Retrieve all necessary fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvoosten committed Nov 5, 2024
1 parent d22a0bf commit a74d21c
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
66 changes: 64 additions & 2 deletions client/src/models/Event.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql } from "@apollo/client"
import Model, { yupDate } from "components/Model"
import Model, { GRAPHQL_ENTITY_AVATAR_FIELDS, yupDate } from "components/Model"
import _isEmpty from "lodash/isEmpty"
import Settings from "settings"
import utils from "utils"
Expand Down Expand Up @@ -130,11 +130,15 @@ export default class Event extends Model {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
eventSeries {
uuid
Expand Down Expand Up @@ -167,17 +171,49 @@ export default class Event extends Model {
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
customFields
}
organizations {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
location {
uuid
name
lat
lng
}
}
people {
uuid
name
rank
status
user
endOfTourDate
${GRAPHQL_ENTITY_AVATAR_FIELDS}
position {
uuid
name
type
code
status
organization {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
location {
uuid
name
}
}
}
}
}
Expand All @@ -200,11 +236,15 @@ export default class Event extends Model {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
eventSeries {
uuid
Expand Down Expand Up @@ -237,22 +277,31 @@ export default class Event extends Model {
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
customFields
}
organizations {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
location {
uuid
name
lat
lng
}
}
people {
uuid
name
rank
avatarUuid
status
user
endOfTourDate
${GRAPHQL_ENTITY_AVATAR_FIELDS}
position {
uuid
name
Expand All @@ -264,6 +313,7 @@ export default class Event extends Model {
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
location {
uuid
Expand All @@ -274,6 +324,7 @@ export default class Event extends Model {
}
}
`

static getEventListQuery = gql`
query ($eventQuery: EventSearchQueryInput) {
eventList(query: $eventQuery) {
Expand All @@ -293,12 +344,14 @@ export default class Event extends Model {
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
eventSeries {
uuid
Expand Down Expand Up @@ -337,23 +390,32 @@ export default class Event extends Model {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
people {
uuid
name
rank
status
user
endOfTourDate
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
updatedAt
}
}
}
`

static getCreateEventMutation = gql`
mutation ($event: EventInput!) {
createEvent(event: $event) {
uuid
}
}
`

static getUpdateEventMutation = gql`
mutation ($event: EventInput!) {
updateEvent(event: $event)
Expand Down
18 changes: 17 additions & 1 deletion client/src/models/EventSeries.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql } from "@apollo/client"
import Model from "components/Model"
import Model, { GRAPHQL_ENTITY_AVATAR_FIELDS } from "components/Model"
import _isEmpty from "lodash/isEmpty"
import Settings from "settings"
import * as yup from "yup"
Expand Down Expand Up @@ -53,10 +53,16 @@ export default class EventSeries extends Model {
hostOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
`

Expand All @@ -69,11 +75,15 @@ export default class EventSeries extends Model {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
}
}
Expand All @@ -91,11 +101,15 @@ export default class EventSeries extends Model {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
}
}
Expand All @@ -117,12 +131,14 @@ export default class EventSeries extends Model {
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
adminOrg {
uuid
shortName
longName
identificationCode
${GRAPHQL_ENTITY_AVATAR_FIELDS}
}
updatedAt
}
Expand Down

0 comments on commit a74d21c

Please sign in to comment.