This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change 47
47
var status = xhr . status ;
48
48
if ( ( ( status >= 200 && status < 300 ) || status === 304 ) && xhr . readyState === 4 ) {
49
49
$log . info ( 'Successfully uploaded file' ) ;
50
- console . log ( xhr . responseText ) ;
51
- var xhrResponse = xhr . responseText ;
50
+ console . log ( ' xhr response: ' , xhr . responseXML ) ;
51
+ var xhrResponse = xhr . responseXML ;
52
52
deferred . resolve ( xhrResponse ) ;
53
53
54
54
} else if ( status >= 400 ) {
78
78
} ) ;
79
79
}
80
80
81
- function updateSubmissionStatus ( ) {
82
-
81
+ function updateSubmissionStatus ( id , data ) {
82
+ // Pass data from upload to S3
83
+ return api . one ( 'submissions' , id ) . customPUT ( data )
84
+ . then ( function ( response ) {
85
+ $log . info ( 'Successfully updated file status' ) ;
86
+ } )
87
+ . catch ( function ( err ) {
88
+ $log . info ( 'Error updating file status' ) ;
89
+ $log . error ( err ) ;
90
+ } ) ;
83
91
}
84
92
85
- function recordCompletedSubmission ( ) {
86
-
93
+ function recordCompletedSubmission ( id , data ) {
94
+ // Once all uploaded, make record and begin processing
95
+ return api . one ( 'submissions' , id ) . customPOST ( data , 'process' )
96
+ . then ( function ( response ) {
97
+ $log . info ( 'Successfully made file record. Beginning processing' ) ;
98
+ } )
99
+ . catch ( function ( err ) {
100
+ $log . info ( 'Error in creating file record' ) ;
101
+ $log . error ( err ) ;
102
+ } ) ;
87
103
}
88
104
} ;
89
105
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments