@@ -33,7 +33,7 @@ const Request = ({ session }) => {
33
33
* as a dynamically routed file, the router query will always consist of a "key: value" pair that's determined by the name of
34
34
* the file (key) and path string (value). additional query properties may also exist if they were explicitly passed.
35
35
*/
36
- const { uuid } = router . query
36
+ const { createRequestError , uuid } = router . query
37
37
const accessToken = session ?. accessToken
38
38
const { request, isLoadingRequest, isRequestError } = useOneRequest ( uuid , accessToken )
39
39
const { allSOWs, isLoadingSOWs, isSOWError } = useAllSOWs ( uuid , request ?. identifier , accessToken )
@@ -78,6 +78,33 @@ const Request = ({ session }) => {
78
78
)
79
79
}
80
80
81
+ // this error is a result of creating the request
82
+ if ( createRequestError ) {
83
+ // TODO(alishaevn): how to handle a "sent to vendor" error?
84
+ const attachmentError = JSON . parse ( createRequestError ) . config . url . includes ( 'notes' )
85
+
86
+ return (
87
+ < Notice
88
+ alert = { attachmentError &&
89
+ {
90
+ body : [ 'Your attachment failed. Please visit your request and try again from the "View Files" tab.' ] ,
91
+ title : 'Attachment Error' ,
92
+ variant : 'info' ,
93
+ }
94
+ }
95
+ dismissible = { false }
96
+ withBackButton = { true }
97
+ buttonProps = { attachmentError &&
98
+ {
99
+ onClick : ( ) => router . push ( { pathname : `/requests/${ uuid } ` } ) ,
100
+ text : 'Click to view your request.' ,
101
+ }
102
+ }
103
+ />
104
+ )
105
+ }
106
+
107
+ // this error is a result of getting the request or its related data
81
108
if ( isError ) {
82
109
return (
83
110
< Notice
0 commit comments