Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
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
Alexandra Rogova
jio_mebibou
Commits
b0d29584
Commit
b0d29584
authored
Jul 05, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
splitstorage.js bug: post update existent document -> fixed
parent
6ca268a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/jio.storage/splitstorage.js
src/jio.storage/splitstorage.js
+6
-5
No files found.
src/jio.storage/splitstorage.js
View file @
b0d29584
...
...
@@ -334,8 +334,9 @@
* @private
* @param {Object} doc A serialized document object
* @param {Object} option Command option properties
* @param {String} method The command method ('post' or 'put')
*/
priv
.
postOrPut
=
function
(
doc
,
option
)
{
priv
.
postOrPut
=
function
(
doc
,
option
,
method
)
{
var
i
,
data
,
doc_list
=
[],
doc_underscores
=
{};
if
(
!
doc
.
_id
)
{
doc
.
_id
=
generateUuid
();
...
...
@@ -356,9 +357,9 @@
(
data
.
length
/
priv
.
storage_list
.
length
)
*
(
i
+
1
)
);
}
priv
.
send
(
'
put
'
,
doc_list
,
option
,
function
(
err
,
response
)
{
priv
.
send
(
method
,
doc_list
,
option
,
function
(
err
,
response
)
{
if
(
err
)
{
err
.
message
=
"
Unable to
post
document
"
;
err
.
message
=
"
Unable to
"
+
method
+
"
document
"
;
delete
err
.
index
;
return
that
.
error
(
err
);
}
...
...
@@ -376,7 +377,7 @@
* @param {Command} command The JIO command
*/
that
.
post
=
function
(
command
)
{
priv
.
postOrPut
(
command
.
cloneDoc
(),
command
.
cloneOption
());
priv
.
postOrPut
(
command
.
cloneDoc
(),
command
.
cloneOption
()
,
'
post
'
);
};
/**
...
...
@@ -386,7 +387,7 @@
* @param {Command} command The JIO command
*/
that
.
put
=
function
(
command
)
{
priv
.
postOrPut
(
command
.
cloneDoc
(),
command
.
cloneOption
());
priv
.
postOrPut
(
command
.
cloneDoc
(),
command
.
cloneOption
()
,
'
put
'
);
};
/**
...
...
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