Sprava eventu a organizaci
This commit is contained in:
@@ -9,6 +9,12 @@ fragment aircraftFullInfo on Aircraft {
|
||||
manufacturer
|
||||
photoUrl
|
||||
seats
|
||||
createdById
|
||||
|
||||
organization {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -17,5 +23,10 @@ fragment aircraftBasicInfo on Aircraft {
|
||||
id
|
||||
callSign
|
||||
manufacturer
|
||||
|
||||
organization {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -21,6 +21,10 @@ fragment flightListInfo on Flight {
|
||||
}
|
||||
}
|
||||
|
||||
event {
|
||||
name
|
||||
}
|
||||
|
||||
takeoffAirport {
|
||||
...airportInfo
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import gql from "graphql-tag";
|
||||
import {FRAGMENT_AIRCRAFT_BASIC_INFO} from "src/graphql/fragments/aircraft";
|
||||
|
||||
export const FRAGMENT_ORGANIZATION_LIST_INFO = gql`
|
||||
fragment organizationListInfo on Organization {
|
||||
id
|
||||
name
|
||||
}
|
||||
`;
|
||||
|
||||
export const FRAGMENT_ORGANIZATION_FULL_INFO = gql`
|
||||
fragment organizationFullInfo on Organization {
|
||||
id
|
||||
name
|
||||
createdById
|
||||
|
||||
users {
|
||||
id
|
||||
name
|
||||
email
|
||||
avatarImageUrl
|
||||
}
|
||||
|
||||
aircrafts {
|
||||
...aircraftBasicInfo
|
||||
}
|
||||
}
|
||||
${FRAGMENT_AIRCRAFT_BASIC_INFO}
|
||||
`;
|
||||
|
||||
// TODO: na info o userovi pouzit fragment - stejne jako v mutaci na pridani/odebrani usera z organizace
|
||||
@@ -0,0 +1,54 @@
|
||||
import gql from "graphql-tag";
|
||||
import {FRAGMENT_ORGANIZATION_FULL_INFO} from "src/graphql/fragments/organization";
|
||||
|
||||
export const CREATE_ORGANIZATION = gql`
|
||||
mutation createOrganization($input: CreateOrganizationInput!) {
|
||||
createOrganization(input: $input) {
|
||||
...organizationFullInfo
|
||||
}
|
||||
}
|
||||
|
||||
${FRAGMENT_ORGANIZATION_FULL_INFO}
|
||||
`;
|
||||
|
||||
export const EDIT_ORGANIZATION = gql`
|
||||
mutation editOrganization($id: Int!, $input: EditOrganizationInput!) {
|
||||
editOrganization(id: $id, input: $input) {
|
||||
...organizationFullInfo
|
||||
}
|
||||
}
|
||||
|
||||
${FRAGMENT_ORGANIZATION_FULL_INFO}
|
||||
`;
|
||||
|
||||
export const ADD_USER_TO_ORGANIZATION = gql`
|
||||
mutation addToOrganization($organizationId: Int!) {
|
||||
addToOrganization(organizationId: $organizationId) {
|
||||
users {
|
||||
id
|
||||
name
|
||||
email
|
||||
avatarImageUrl
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
export const REMOVE_USER_FROM_ORGANIZATION = gql`
|
||||
mutation removeFromOrganization($organizationId: Int!) {
|
||||
removeFromOrganization(organizationId: $organizationId) {
|
||||
users {
|
||||
id
|
||||
name
|
||||
email
|
||||
avatarImageUrl
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
// export const DELETE_ORGANIZATION = gql`
|
||||
// mutation deleteOrganization($id: Int!) {
|
||||
// deleteOrganization(id: $id) {
|
||||
// id
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
@@ -0,0 +1,22 @@
|
||||
import gql from "graphql-tag";
|
||||
import {FRAGMENT_ORGANIZATION_FULL_INFO, FRAGMENT_ORGANIZATION_LIST_INFO} from "src/graphql/fragments/organization";
|
||||
|
||||
export const ORGANIZATIONS_LIST = gql`
|
||||
query organizationsList {
|
||||
organizations {
|
||||
...organizationListInfo
|
||||
}
|
||||
}
|
||||
|
||||
${FRAGMENT_ORGANIZATION_LIST_INFO}
|
||||
`;
|
||||
|
||||
export const ORGANIZATION_DETAIL = gql`
|
||||
query organization($id: Int!) {
|
||||
organization(id: $id) {
|
||||
...organizationFullInfo
|
||||
}
|
||||
}
|
||||
|
||||
${FRAGMENT_ORGANIZATION_FULL_INFO}
|
||||
`;
|
||||
@@ -16,6 +16,11 @@ export const LOGGED_USER_DETAIL = gql`
|
||||
query loggedUserDetail {
|
||||
loggedUser {
|
||||
...userFullInfo
|
||||
|
||||
organizations {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user