import {useSubscription, gql, useMutation} from '@apollo/client'; import React from "react"; import usePatchedSubscription from "./usePatchedSubscription"; export default function PresPresentationUploadToken({userId}) { const [requestPresentationUploadToken] = useMutation(gql` mutation RequestPresentationUploadToken($podId: String!, $filename: String!, $uploadTemporaryId: String!) { requestPresentationUploadToken( podId: $podId, filename: $filename, uploadTemporaryId: $uploadTemporaryId, ) } `); const handleRequestPresentationUploadToken = (filename) => { requestPresentationUploadToken({ variables: { podId: 'DEFAULT_PRESENTATION_POD', filename, uploadTemporaryId: 'PRES' + new Date().getTime(), }, }); }; const { loading, error, data } = usePatchedSubscription( gql`subscription { pres_presentation_uploadToken { presentationId uploadTemporaryId uploadToken } }` ); return !loading && !error && ( {data.map((curr) => { return ( ); })}
Upload Token
presentationId uploadTemporaryId uploadToken
{curr.presentationId} {curr.uploadTemporaryId} {curr.uploadToken}
); }