Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
zesje
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Réouven ASSOULY
zesje
Commits
ee892484
Commit
ee892484
authored
7 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
allow multiple simultaneous PDF uploads
parent
4b2379bc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/views/Exams.js
+16
-15
16 additions, 15 deletions
client/views/Exams.js
with
16 additions
and
15 deletions
client/views/Exams.js
+
16
−
15
View file @
ee892484
...
...
@@ -120,21 +120,22 @@ class Exams extends React.Component {
alert
(
'
Please upload a PDF..
'
)
return
}
var
data
=
new
FormData
()
data
.
append
(
'
pdf
'
,
accepted
[
0
])
api
.
post
(
'
pdfs/
'
+
this
.
state
.
selected_exam
.
id
,
data
)
.
then
(()
=>
{
api
.
get
(
'
pdfs/
'
+
this
.
state
.
selected_exam
.
id
)
.
then
(
pdfs
=>
this
.
setState
(
prev
=>
({
selected_exam
:
Object
.
assign
(
prev
.
selected_exam
,
{
pdfs
:
pdfs
})
}))
)
alert
(
'
Thank you for your upload, it was delicious
'
)
})
.
catch
(
resp
=>
{
alert
(
'
failed to upload pdf (see javascript console for details)
'
)
console
.
error
(
'
failed to upload PDF:
'
,
resp
)
accepted
.
map
(
file
=>
{
var
data
=
new
FormData
()
data
.
append
(
'
pdf
'
,
file
)
api
.
post
(
'
pdfs/
'
+
this
.
state
.
selected_exam
.
id
,
data
)
.
then
(()
=>
{
api
.
get
(
'
pdfs/
'
+
this
.
state
.
selected_exam
.
id
)
.
then
(
pdfs
=>
this
.
setState
(
prev
=>
({
selected_exam
:
Object
.
assign
(
prev
.
selected_exam
,
{
pdfs
:
pdfs
})
}))
)
})
.
catch
(
resp
=>
{
alert
(
'
failed to upload pdf (see javascript console for details)
'
)
console
.
error
(
'
failed to upload PDF:
'
,
resp
)
})
})
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment