Skip to content

Commit

Permalink
Fixed slash issue and added raw property.
Browse files Browse the repository at this point in the history
  • Loading branch information
janhommes committed Nov 8, 2017
1 parent 35ab885 commit b153570
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions o.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// +++
// o.js v0.3.4
// o.js v0.3.7
//
// o.js is a simple oData wrapper for JavaScript.
// Currently supporting the following operations:
// .get() / .post() / .put() / .delete() / .first() / .take() / .skip() / .filter() / .orderBy() / .orderByDesc() / .count() /.search() / .select() / .any() / .ref() / .deleteRef()
//
// By Jan Hommes
// Date: 06/07/2017
// Contributors: Matteo Antony Mistretta (https://github.com/IceOnFire)
// Date: 11/08/2017
// Contributors: Matteo Antony Mistretta (https://github.com/IceOnFire),
//
// --------------------
// The MIT License (MIT)
Expand Down Expand Up @@ -157,6 +157,7 @@
base.inlinecount = null; //if inlinecount is set, here the counting is gold
base.param = {}; //this object holds all parameter for a route
base.oConfig = config; //the internal config, passed over from the o function
base.raw = null; //holds the data after an callback (raw data, containing also metadata)


// ---------------------+++ PUBLICS +++----------------------------
Expand Down Expand Up @@ -725,7 +726,7 @@
queryStr += '/';
}

if (typeof res.appending === 'undefined' || res.appending === null) {
if (!res.appending) {
queryStr = queryStr.slice(0, -1);
}

Expand Down Expand Up @@ -1470,6 +1471,7 @@
else {
if (JSON && response !== '') {
var data = JSON.parse(response);
tempBase.raw = data;
if (data.hasOwnProperty('value')) {
if (isQuery(['$first']) && data.value.length && data.value.length <= 1) {
tempBase.data = data.value[0];
Expand Down
Loading

0 comments on commit b153570

Please sign in to comment.