Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Hardik Juneja
jio
Commits
4d825607
Commit
4d825607
authored
11 years ago
by
Tristan Cavelier
Browse files
Options
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
,
...
...
This diff is collapsed.
Click to expand it.
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
()
{
...
...
This diff is collapsed.
Click to expand it.
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