Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jio
Commits
4d825607
Commit
4d825607
authored
Oct 30, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localstorage.js putAttachment status code bug fix
was returning 201 or 200 instead of 204 or 201
parent
a80625b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/jio.storage/localstorage.js
src/jio.storage/localstorage.js
+2
-2
test/jio.storage/localstorage.tests.js
test/jio.storage/localstorage.tests.js
+2
-2
No files found.
src/jio.storage/localstorage.js
View file @
4d825607
...
...
@@ -215,7 +215,7 @@
* @param {Object} options The command options
*/
LocalStorage
.
prototype
.
putAttachment
=
function
(
command
,
param
)
{
var
that
=
this
,
doc
,
status
=
"
ok
"
;
var
that
=
this
,
doc
,
status
=
"
created
"
;
doc
=
this
.
_storage
.
getItem
(
this
.
_localpath
+
"
/
"
+
param
.
_id
);
if
(
doc
===
null
)
{
// the document does not exist
...
...
@@ -231,7 +231,7 @@
jIO
.
util
.
readBlobAsBinaryString
(
param
.
_blob
).
then
(
function
(
e
)
{
doc
.
_attachments
=
doc
.
_attachments
||
{};
if
(
doc
.
_attachments
[
param
.
_attachment
])
{
status
=
"
created
"
;
status
=
"
no_content
"
;
}
doc
.
_attachments
[
param
.
_attachment
]
=
{
"
content_type
"
:
param
.
_blob
.
type
,
...
...
test/jio.storage/localstorage.tests.js
View file @
4d825607
...
...
@@ -344,8 +344,8 @@
"
id
"
:
"
putattmt1
"
,
"
method
"
:
"
putAttachment
"
,
"
result
"
:
"
success
"
,
"
status
"
:
20
0
,
"
statusText
"
:
"
Ok
"
"
status
"
:
20
1
,
"
statusText
"
:
"
Created
"
},
"
PutAttachment to a document, without data
"
);
}).
then
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment