Moznost nahravat fotky copilotem

This commit is contained in:
Michal Kváček
2024-03-07 06:45:22 +01:00
parent f0a4c439dc
commit cd9c7351e9
22 changed files with 550 additions and 216 deletions
+10 -2
View File
@@ -11,18 +11,26 @@ fragment copilotListInfo on Copilot {
}
`;
export const FRAGMENT_COPILOT_FULL_INFO = gql`
fragment copilotFullInfo on Copilot {
export const FRAGMENT_COPILOT_PUBLIC_INFO = gql`
fragment copilotPublicInfo on Copilot {
id
name
isPublic
urlSlug
}
`
export const FRAGMENT_COPILOT_FULL_INFO = gql`
fragment copilotFullInfo on Copilot {
...copilotPublicInfo
titlePhoto {
id
url
}
}
${FRAGMENT_COPILOT_PUBLIC_INFO}
`;
export const FRAGMENT_COPILOT_FULL_PRIVATE_INFO = gql`
+7 -7
View File
@@ -3,6 +3,7 @@ import {FRAGMENT_AIRCRAFT_FULL_INFO} from "src/graphql/fragments/aircraft";
import {FRAGMENT_AIRPORT_INFO} from "src/graphql/fragments/airport";
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
import {FRAGMENT_POI_FULL_INFO} from "src/graphql/fragments/poi";
import {FRAGMENT_COPILOT_PUBLIC_INFO} from "src/graphql/fragments/copilot";
export const FRAGMENT_WEATHER_FULL_INFO = gql`
fragment weatherFullInfo on WeatherInfo {
@@ -51,13 +52,6 @@ fragment flightFullInfo on Flight {
...weatherFullInfo
}
copilots {
id
name
isPublic
urlSlug
}
event {
id
isPublic
@@ -107,6 +101,11 @@ fragment flightFullPrivateInfo on Flight {
...flightFullInfo
debriefingNotes
copilots {
...copilotPublicInfo
token
}
photos {
...photoFullInfo
@@ -124,4 +123,5 @@ fragment flightFullPrivateInfo on Flight {
${FRAGMENT_FLIGHT_FULL_INFO}
${FRAGMENT_PHOTO_FULL_INFO}
${FRAGMENT_COPILOT_PUBLIC_INFO}
`;
+4 -4
View File
@@ -23,8 +23,8 @@ mutation editPhoto($id: Int!, $input: EditPhotoInput!) {
`;
export const CHANGE_PHOTO_ORIENTATION = gql`
mutation changeOrientation($id: Int!, $direction: String!) {
changeOrientation(id: $id, direction: $direction) {
mutation changeOrientation($id: Int!, $direction: String!, $copilotUploadToken: String) {
changeOrientation(id: $id, direction: $direction, copilotUploadToken: $copilotUploadToken) {
...photoFullInfo
flight {
@@ -67,8 +67,8 @@ mutation adjustPhoto($id: Int!, $adjustment: AdjustmentInput!) {
// TODO: ^^ udelat z toho asi jeden fragment a pouzit i v query GET_PHOTO
export const DELETE_PHOTO = gql`
mutation deletePhoto($id: Int!) {
deletePhoto(id: $id) {
mutation deletePhoto($id: Int!, $copilotUploadToken: String) {
deletePhoto(id: $id, copilotUploadToken: $copilotUploadToken) {
id
}
}
+8 -2
View File
@@ -34,8 +34,14 @@ ${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const COPILOT_PUBLIC_DETAIL = gql`
query copilot($urlSlug: String!, $pilotUsername: String) {
copilot(urlSlug: $urlSlug, pilotUsername: $pilotUsername, public: true) {
query copilot($urlSlug: String, $uploadToken: String, $uploadFlightSlug: String, $pilotUsername: String!) {
copilot(
urlSlug: $urlSlug,
uploadToken: $uploadToken,
uploadFlightSlug: $uploadFlightSlug,
pilotUsername: $pilotUsername,
public: true
) {
...copilotFullInfo
}
}
+7 -1
View File
@@ -2,6 +2,7 @@ import gql from "graphql-tag";
import {FRAGMENT_FLIGHT_FULL_INFO, FRAGMENT_FLIGHT_FULL_PRIVATE_INFO} from "src/graphql/fragments/flight";
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
import {FRAGMENT_COPILOT_PUBLIC_INFO} from "src/graphql/fragments/copilot";
export const FLIGHTS_LIST = gql`
query FlightsList($eventId: Int, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $limit: Int!, $offset: Int) {
@@ -58,12 +59,17 @@ ${FRAGMENT_FLIGHT_FULL_PRIVATE_INFO}
`;
export const FLIGHT_PUBLIC_DETAIL = gql`
query FlightPublicDetail($urlSlug: String!, $username: String) {
query FlightPublicDetail($urlSlug: String, $username: String) {
flight(urlSlug: $urlSlug, username: $username, public: true) {
...flightFullInfo
copilots {
...copilotPublicInfo
}
}
}
${FRAGMENT_FLIGHT_FULL_INFO}
${FRAGMENT_COPILOT_PUBLIC_INFO}
`;
+15 -2
View File
@@ -39,8 +39,21 @@ ${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const PHOTOS_PUBLIC_LIST = gql`
query publicPhotos($flightId: Int, $pointOfInterestId: Int, $aircraftId: Int, $copilotId: Int) {
photos(public: true, flightId: $flightId, pointOfInterestId: $pointOfInterestId, aircraftId: $aircraftId, copilotId: $copilotId) {
query publicPhotos(
$flightId: Int,
$pointOfInterestId: Int,
$aircraftId: Int,
$copilotId: Int,
$uploadedByCopilotId: Int
) {
photos(
public: true,
flightId: $flightId,
pointOfInterestId: $pointOfInterestId,
aircraftId: $aircraftId,
copilotId: $copilotId,
uploadedByCopilotId: $uploadedByCopilotId
) {
...photoFullInfo
}
}