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
6573ab6c
Commit
6573ab6c
authored
Apr 02, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post method added to indexeddbstorage
parent
8fa98134
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+25
-1
No files found.
src/jio.storage/indexeddbstorage.js
View file @
6573ab6c
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
}([
"
jio
"
,
"
rsvp
"
],
function
(
jIO
,
RSVP
)
{
}([
"
jio
"
,
"
rsvp
"
],
function
(
jIO
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
var
Promise
=
RSVP
.
Promise
;
var
Promise
=
RSVP
.
Promise
,
generateUuid
=
jIO
.
util
.
generateUuid
;
// XXX doc string
// XXX doc string
function
metadataObjectToString
(
value
)
{
function
metadataObjectToString
(
value
)
{
...
@@ -287,6 +287,30 @@
...
@@ -287,6 +287,30 @@
},
command
.
error
,
command
.
notify
);
},
command
.
error
,
command
.
notify
);
};
};
// XXX doc string
IndexedDBStorage
.
prototype
.
post
=
function
(
command
,
metadata
)
{
var
promise
;
promise
=
this
.
createDBIfNecessary
();
if
(
metadata
.
_id
)
{
promise
=
promise
.
then
(
this
.
getMetadata
.
bind
(
this
,
metadata
.
_id
)).
then
(
function
()
{
throw
"
conflict
"
;
},
function
(
error
)
{
if
(
error
===
"
not_found
"
)
{
return
;
}
throw
error
;
});
}
else
{
metadata
.
_id
=
generateUuid
();
}
promise
.
then
(
this
.
putMetadata
.
bind
(
this
,
metadata
)).
then
(
function
()
{
command
.
success
({
"
id
"
:
metadata
.
_id
});
},
command
.
error
,
command
.
notify
);
};
// XXX doc string
// XXX doc string
IndexedDBStorage
.
prototype
.
put
=
function
(
command
,
metadata
)
{
IndexedDBStorage
.
prototype
.
put
=
function
(
command
,
metadata
)
{
var
status
;
var
status
;
...
...
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